View Javadoc

1   /*
2    * $Id$
3    * 
4    * Created on 26 Jan 2010 by Paul Harrison (paul.harrison@manchester.ac.uk)
5    *
6    * Adapted from official SOFA C implementation http://www.iausofa.org/
7    */ 
8   
9   package org.jastronomy.jsofa;
10  
11  import static java.lang.StrictMath.*; 
12  
13  /**
14   * Java implementation of Standards of Fundamental Astronomy. <a href="http://www.iausofa.org/">http://www.iausofa.org/</a>
15   * 
16   * This code has been created by hand translating the official C version.
17   * 
18   * @author Paul Harrison (paul.harrison@manchester.ac.uk) 02 Apr 2014
19   * @version JSOFA Release 20180130
20   * @since 26 Jan 2010
21   */
22  public class JSOFA {
23      /** tracked IAU SOFA release {@value}. */
24      public final static String SOFA_RELEASE = "2019-07-22";
25      
26      /** JSOFA release {@value}*/
27      public final static String JSOFA_RELEASE = "20190722";
28  
29      /** tracked IAU SOFA revision {@value}. */
30      public final static String SOFA_REVISION = "15";
31  
32      /** Release year for this version of jauDat {@value} */
33  public final static int IYV = 2019;
34      /** The latest confirmed omission of a leap second form IERS */
35  public final static JulianDate latestConfirmedNoLeapSecondChange;
36  static {
37      JulianDate tmpval = new JulianDate(0,0);
38      try {
39          tmpval = jauCal2jd(2019,7,1); // this is from the IERS
40      } catch (JSOFAIllegalParameter e) {
41          // should not happen
42          e.printStackTrace();
43      }
44      latestConfirmedNoLeapSecondChange = tmpval;
45  }
46  static class LeapInfo {
47      final public int iyear, month;
48      final public double delat;
49      public LeapInfo(int i, int m, double t) {
50         iyear = i;
51         month = m;
52         delat = t;
53      }
54   }
55  
56  /* Dates and Delta(AT)s */
57  static final LeapInfo leapSeconds[] = {
58       new LeapInfo( 1960,  1,  1.4178180 ),
59       new LeapInfo( 1961,  1,  1.4228180 ),
60       new LeapInfo( 1961,  8,  1.3728180 ),
61       new LeapInfo( 1962,  1,  1.8458580 ),
62       new LeapInfo( 1963, 11,  1.9458580 ),
63       new LeapInfo( 1964,  1,  3.2401300 ),
64       new LeapInfo( 1964,  4,  3.3401300 ),
65       new LeapInfo( 1964,  9,  3.4401300 ),
66       new LeapInfo( 1965,  1,  3.5401300 ),
67       new LeapInfo( 1965,  3,  3.6401300 ),
68       new LeapInfo( 1965,  7,  3.7401300 ),
69       new LeapInfo( 1965,  9,  3.8401300 ),
70       new LeapInfo( 1966,  1,  4.3131700 ),
71       new LeapInfo( 1968,  2,  4.2131700 ),
72       new LeapInfo( 1972,  1, 10.0       ),
73       new LeapInfo( 1972,  7, 11.0       ),
74       new LeapInfo( 1973,  1, 12.0       ),
75       new LeapInfo( 1974,  1, 13.0       ),
76       new LeapInfo( 1975,  1, 14.0       ),
77       new LeapInfo( 1976,  1, 15.0       ),
78       new LeapInfo( 1977,  1, 16.0       ),
79       new LeapInfo( 1978,  1, 17.0       ),
80       new LeapInfo( 1979,  1, 18.0       ),
81       new LeapInfo( 1980,  1, 19.0       ),
82       new LeapInfo( 1981,  7, 20.0       ),
83       new LeapInfo( 1982,  7, 21.0       ),
84       new LeapInfo( 1983,  7, 22.0       ),
85       new LeapInfo( 1985,  7, 23.0       ),
86       new LeapInfo( 1988,  1, 24.0       ),
87       new LeapInfo( 1990,  1, 25.0       ),
88       new LeapInfo( 1991,  1, 26.0       ),
89       new LeapInfo( 1992,  7, 27.0       ),
90       new LeapInfo( 1993,  7, 28.0       ),
91       new LeapInfo( 1994,  7, 29.0       ),
92       new LeapInfo( 1996,  1, 30.0       ),
93       new LeapInfo( 1997,  7, 31.0       ),
94       new LeapInfo( 1999,  1, 32.0       ),
95       new LeapInfo( 2006,  1, 33.0       ),
96       new LeapInfo( 2009,  1, 34.0       ),
97       new LeapInfo( 2012,  7, 35.0       ),
98       new LeapInfo( 2015,  7, 36.0       ),
99       new LeapInfo( 2017,  1, 37.0       )
100   };
101 
102 
103     /** Seconds of time to radians {@value} */
104     public final static double DS2R = (7.272205216643039903848712e-5);
105 
106     /** Pi {@value}*/
107     public final static double DPI = (3.141592653589793238462643);
108 
109     /** 2Pi {@value}*/
110     public final static double D2PI = (6.283185307179586476925287);
111 
112     /** Radians to degrees {@value} */
113     public final static double DR2D = (57.29577951308232087679815);
114 
115     /** Degrees to radians {@value}*/
116     public final static double DD2R = (1.745329251994329576923691e-2);
117 
118     /** Radians to arcseconds {@value}*/
119     public final static double DR2AS = (206264.8062470963551564734);
120 
121     /** Arcseconds to radians {@value}*/
122     public final static double DAS2R = (4.848136811095359935899141e-6);
123 
124     /** Arcseconds in a full circle {@value}*/
125     public final static double TURNAS = (1296000.0);
126 
127     /** Milliarcseconds to radians {@value}*/
128     public final static double DMAS2R = (DAS2R / 1e3);
129 
130     /** Length of tropical year B1900 (days) {@value}*/
131     public final static double DTY = (365.242198781);
132 
133     /** Reference epoch (J2000.0), Julian Date {@value}*/
134     public final static double DJ00 = (2451545.0);
135 
136     /** Julian Date of Modified Julian Date zero {@value}*/
137     public final static double DJM0 = (2400000.5);
138 
139     /** Reference epoch (J2000.0), Modified Julian Date {@value} */
140     public final static double DJM00 = (51544.5);
141 
142     /** Seconds per day. {@value}*/
143     public final static double DAYSEC = (86400.0);
144 
145     /** Days per Julian year */
146     public final static double DJY = (365.25);
147 
148     /** Days per Julian century {@value} */
149     public final static double DJC = (36525.0);
150 
151     /** Days per Julian millennium {@value} */
152     public final static double DJM = (365250.0);
153     
154     /** 1977 Jan 1.0 as MJD */
155     public final static double DJM77 = (43144.0);
156 
157     /** TT minus TAI (s) */
158     public final static double TTMTAI = (32.184);
159 
160 
161     /**  Astronomical unit (m) IAU 2012 {@value} */
162     public final static double DAU = (149597870.7e3);
163     
164     /** Speed of light (m/s) {@value} */
165     public final static double CMPS = 299792458.0;
166 
167     /** Light time for 1 au (s) {@value} */
168     public final static double AULT = (DAU/CMPS);
169 
170 
171     /** Speed of light (au per day) {@value} */
172     public final static double DC = (DAYSEC / AULT);
173     
174     /** L_G = 1 - d(TT)/d(TCG) */
175     public final static double ELG = (6.969290134e-10);
176 
177     /** L_B = 1 - d(TDB)/d(TCB) at TAI 1977/1/1.0 */
178     public final static double ELB = (1.550519768e-8);
179     
180     /** Schwarzschild radius of the Sun (au) {@value}
181      = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
182     public final static double SRS = 1.97412574336e-8;
183 
184     
185     /** TDB (s) at TAI 1977/1/1.0 */
186     public final static double TDB0 = (-6.55e-5);
187 
188     private final static double TANGENT_TINY = 1e-6;
189 
190     /** dint(A) - truncate to nearest whole number towards zero (double)  */
191     private static double dint(final double A){ return ((A)<0.0?ceil(A):floor(A));}
192 
193     /** dnint(A) - round to nearest whole number (double)  */
194     private static double dnint(final double A){return ((A)<0.0?ceil((A)-0.5):floor((A)+0.5));}
195 
196     /** dsign(A,B) - magnitude of A with sign of B (double) */
197     private static double dsign(final double A, double B){return ((B)<0.0?-abs(A):abs(A));}
198 
199      
200     
201     /**
202      * Julian Date representation. The actual date is djm0+djm1, apportioned in any
203      *     convenient way between the two arguments.  For example,
204      *     JD(TT)=2450123.7 could be expressed in any of these ways,
205      *     among others:
206      *<pre>
207      *            djm0          djm1
208      *
209      *         2450123.7           0.0       (JD method)
210      *         2451545.0       -1421.3       (J2000 method)
211      *         2400000.5       50123.2       (MJD method)
212      *         2450123.5           0.2       (date &amp;time method)
213      *</pre>
214      * 
215      * The JD method is the most natural and convenient to use in
216      *     cases where the loss of several decimal digits of resolution
217      *     is acceptable.  The J2000 method is best matched to the way
218      *     the argument is handled internally and will deliver the
219      *     optimum resolution.  The MJD method and the date &amp;time methods
220      *     are both good compromises between resolution and convenience.
221      * 
222      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Jan 2010
223      * 
224      * 
225      */
226     public static class JulianDate implements Comparable<JulianDate>{
227         /**  MJD zero-point */
228         public double djm0;  
229         /** MJD offset */
230         public double djm1;
231         public JulianDate(double d1, double d2) {
232             djm0 = d1;
233             djm1 = d2;
234         }
235         /**
236          * {@inheritDoc}
237          * overrides @see java.lang.Comparable#compareTo(java.lang.Object)
238          */
239         @Override
240         public int compareTo(JulianDate o) {
241             if(this == o) return 0;
242             final Double thismjd = this.djm0 + this.djm1;
243             final Double thatmjd = o.djm0 + o.djm1;
244 
245             return thismjd.compareTo(thatmjd);
246         }
247         /**
248          * {@inheritDoc}
249          * overrides @see java.lang.Object#hashCode()
250          */
251         @Override
252         public int hashCode() {
253             final int prime = 31;
254             int result = 1;
255             long temp;
256             temp = Double.doubleToLongBits(djm0);
257             result = prime * result + (int) (temp ^ (temp >>> 32));
258             temp = Double.doubleToLongBits(djm1);
259             result = prime * result + (int) (temp ^ (temp >>> 32));
260             return result;
261         }
262         /**
263          * {@inheritDoc}
264          * overrides @see java.lang.Object#equals(java.lang.Object)
265          */
266         @Override
267         public boolean equals(Object obj) {
268             if (this == obj)
269                 return true;
270             if (obj == null)
271                 return false;
272             if (!(obj instanceof JulianDate))
273                 return false;
274             JulianDate other = (JulianDate) obj;
275             if (Double.doubleToLongBits(djm0) != Double
276                     .doubleToLongBits(other.djm0))
277                 return false;
278             if (Double.doubleToLongBits(djm1) != Double
279                     .doubleToLongBits(other.djm1))
280                 return false;
281             return true;
282         }
283         /**
284          * {@inheritDoc}
285          * overrides @see java.lang.Object#toString()
286          */
287         @Override
288         public String toString() {
289             return String.format("MJD=%.9f", djm0 + djm1  - DJM0);
290         }
291     }
292  
293     /**
294     * Decompose radians into degrees, arcminutes, arcseconds, fraction.
295     *  
296     *
297     *  <p>This function is derived from the International Astronomical Union's
298     *  SOFA (Standards Of Fundamental Astronomy) software collection.
299     *
300     *  <p>Status:  vector/matrix support function.
301     *  
302     *
303     *
304     *<p>Called:<ul>
305     *     <li>{@link #jauD2tf}      decompose days to hms
306     *</ul>
307     * <p>Notes:
308     *<ol>
309     *  <li> The argument ndp is interpreted as follows:
310     *
311     * <pre>
312     *     ndp         resolution
313     *      :      ...0000 00 00
314     *     -7         1000 00 00
315     *     -6          100 00 00
316     *     -5           10 00 00
317     *     -4            1 00 00
318     *     -3            0 10 00
319     *     -2            0 01 00
320     *     -1            0 00 10
321     *      0            0 00 01
322     *      1            0 00 00.1
323     *      2            0 00 00.01
324     *      3            0 00 00.001
325     *      :            0 00 00.000...
326     *</pre>
327     *  <li> The largest positive useful value for ndp is determined by the
328     *     size of angle, the format of doubles on the target platform, and
329     *     the risk of overflowing idmsf[3].  On a typical platform, for
330     *     angle up to 2pi, the available floating-point precision might
331     *     correspond to ndp=12.  However, the practical limit is typically
332     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
333     *     only 16 bits.
334     *
335     *  <li> The absolute value of angle may exceed 2pi.  In cases where it
336     *     does not, it is up to the caller to test for and handle the
337     *     case where angle is very nearly 2pi and rounds up to 360 degrees,
338     *     by testing for idmsf[0]=360 and setting idmsf[0-3] to zero.
339     *</ol>
340     *@version 2008 May 27
341     *
342     *  @since Release 20101201
343     *
344     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
345     * <!-- Given: -->
346     *    @param ndp     int     resolution (Note 1)
347     *    @param angle   double  angle in radians
348     *    @param idmsf   int[4] <u>returned</u> degrees, arcminutes, arcseconds, fraction
349     * <!-- Returned: -->
350     *    @return sign    char    '+' or '-'
351     */
352     public static char jauA2af(final int ndp, final double angle,  int idmsf[] ){
353         /* Hours to degrees * radians to turns */
354         final double F = 15.0 / D2PI;
355 
356 
357      /* Scale then use days to h,m,s function. */
358         char retval = jauD2tf(ndp, angle*F, idmsf);
359 
360         return retval;
361 
362         
363     }
364     
365 
366     
367     /**
368     *  Decompose radians into hours, minutes, seconds, fraction.
369     *
370     *<p>This function is derived from the International Astronomical Union's
371     *  SOFA (Standards Of Fundamental Astronomy) software collection.
372     *
373     *<p>Status:  vector/matrix support function.
374     *
375     *<!-- Given: -->
376     *     @param ndp      int      resolution (Note 1)
377     *     @param angle    double   angle in radians
378     *
379     *<!-- Returned: -->
380     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
381     *     @return sign     char      <u>returned</u> '+' or '-'
382     *
383     *<p>Called:<ul>
384     *     <li>{@link #jauD2tf} decompose days to hms
385     * </ul>
386     * <p>Notes:
387     * <ol>
388     *
389     * <li> The argument ndp is interpreted as follows:
390     * <pre>
391     *     ndp         resolution
392     *      :      ...0000 00 00
393     *     -7         1000 00 00
394     *     -6          100 00 00
395     *     -5           10 00 00
396     *     -4            1 00 00
397     *     -3            0 10 00
398     *     -2            0 01 00
399     *     -1            0 00 10
400     *      0            0 00 01
401     *      1            0 00 00.1
402     *      2            0 00 00.01
403     *      3            0 00 00.001
404     *      :            0 00 00.000...
405     *</pre>
406     * <li> The largest positive useful value for ndp is determined by the
407     *     size of angle, the format of doubles on the target platform, and
408     *     the risk of overflowing ihmsf[3].  On a typical platform, for
409     *     angle up to 2pi, the available floating-point precision might
410     *     correspond to ndp=12.  However, the practical limit is typically
411     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
412     *     only 16 bits.
413     *
414     * <li> The absolute value of angle may exceed 2pi.  In cases where it
415     *     does not, it is up to the caller to test for and handle the
416     *     case where angle is very nearly 2pi and rounds up to 24 hours,
417     *     by testing for ihmsf[0]=24 and setting ihmsf(0-3) to zero.
418     *</ol>
419     *  @version 2008 May 11
420     *
421     *  @since Release 20101201
422     *
423     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
424     */
425     public static char jauA2tf(final int ndp, final double angle, int ihmsf[])
426     {
427     /* Scale then use days to h,m,s function. */
428      return  jauD2tf(ndp, angle/D2PI, ihmsf);
429 
430      }
431     
432 
433     /**
434     *  Normalize angle into the range {@code 0 <= a < 2pi}.
435     *
436     *<p>This function is derived from the International Astronomical Union's
437     *  SOFA (Standards Of Fundamental Astronomy) software collection.
438     *
439     *<p>Status:  vector/matrix support function.
440     *
441     *<!-- Given: -->
442     *     @param a         double      angle (radians)
443     *
444     * <!-- Returned (function value): -->
445     *  @return double     angle in range 0-2pi
446     *
447     *@version 2008 May 16
448     *
449     *  @since Release 20101201
450     *
451     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
452     */
453     public static double jauAnp(final double a)
454    {
455        double w;
456 
457 
458        w = fmod(a, D2PI);
459        if (w < 0) w += D2PI;
460 
461        return w;
462 
463     }
464     
465 
466     /**
467     *  Normalize angle into the range  {@code -pi <= a < +pi}.
468     *
469     *<p>This function is derived from the International Astronomical Union's
470     *  SOFA (Standards Of Fundamental Astronomy) software collection.
471     *
472     *<p>Status:  vector/matrix support function.
473     *
474     *<!-- Given: -->
475     *     @param a         double      angle (radians)
476     *
477     * <!-- Returned (function value): -->
478     *  @return double     angle in range +/-pi
479     *
480     *@version 2008 May 16
481     *
482     *  @since Release 20101201
483     *
484     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
485     */
486     public static double jauAnpm(final double a)
487     {
488        double w;
489 
490 
491        w = fmod(a, D2PI);
492        if (abs(w) >= DPI) w -= dsign(D2PI, a);
493 
494        return w;
495 
496         }
497     /**
498      * Frame bias components of IAU 2000 precession-nutation models.
499      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 2 Feb 2010
500      * 
501      * @since AIDA Stage 1
502      */
503     public static class FrameBias {
504         /** longitude  corrections */
505         public double dpsibi;
506         /**obliquity corrections */
507         public double depsbi;
508         /** the ICRS RA of the J2000.0 mean equinox */
509         public double dra;
510     };
511 
512     /**
513     *  Frame bias components of IAU 2000 precession-nutation models (part
514     *  of MHB2000 with additions).
515     *
516     *<p>This function is derived from the International Astronomical Union's
517     *  SOFA (Standards Of Fundamental Astronomy) software collection.
518     *
519     *<p>Status:  canonical model.
520     *
521     *<!-- Returned: -->
522     *     @return dpsibi,depsbi   double    <u>returned</u> longitude and obliquity corrections
523     *             dra             double    <u>returned</u> the ICRS RA of the J2000.0 mean equinox
524     *
525     * <p>Notes:
526     * <ol>
527     *
528     * <li> The frame bias corrections in longitude and obliquity (radians)
529     *     are required in order to correct for the offset between the GCRS
530     *     pole and the mean J2000.0 pole.  They define, with respect to the
531     *     GCRS frame, a J2000.0 mean pole that is consistent with the rest
532     *     of the IAU 2000A precession-nutation model.
533     *
534     * <li> In addition to the displacement of the pole, the complete
535     *     description of the frame bias requires also an offset in right
536     *     ascension.  This is not part of the IAU 2000A model, and is from
537     *     Chapront et al. (2002).  It is returned in radians.
538     *
539     * <li> This is a supplemented implementation of one aspect of the IAU
540     *     2000A nutation model, formally adopted by the IAU General
541     *     Assembly in 2000, namely MHB2000 (Mathews et al. 2002).
542     *</ol>
543     *<p>References:
544     *
545     *     Chapront, J., Chapront-Touze, M. &amp;Francou, G., Astron.
546     *     Astrophys., 387, 700, 2002.
547     *
548     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
549     *     and precession   New nutation series for nonrigid Earth and
550     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
551     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
552     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
553     *
554     *@version 2009 December 17
555     *
556     *  @since Release 20101201
557     *
558     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
559     */
560     public static FrameBias jauBi00()
561    {
562     /* The frame bias corrections in longitude and obliquity */
563        final double DPBIAS = -0.041775  * DAS2R,
564                     DEBIAS = -0.0068192 * DAS2R;
565 
566     /* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */
567        final double DRA0 = -0.0146 * DAS2R;
568 
569 
570     /* Return the results (which are fixed). */
571        FrameBias retval = new FrameBias();
572        retval.dpsibi = DPBIAS;
573        retval.depsbi = DEBIAS;
574        retval.dra = DRA0;
575 
576        return retval;
577 
578         }
579     
580 
581     /**
582     *  Frame bias and precession, IAU 2000.
583     *
584     *<p>This function is derived from the International Astronomical Union's
585     *  SOFA (Standards Of Fundamental Astronomy) software collection.
586     *
587     *<p>Status:  canonical model.
588     *
589     *<!-- Given: -->
590     *      @param date1  double          TT as a 2-part Julian Date (Note 1)
591     *      @param date2   double          TT as a 2-part Julian Date (Note 1)
592     *
593     *<!-- Returned: -->
594     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
595     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
596     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
597     *
598     * <p>Notes:
599     * <ol>
600     *
601     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
602     *     convenient way between the two arguments.  For example,
603     *     JD(TT)=2450123.7 could be expressed in any of these ways,
604     *     among others:
605     *<pre>
606     *             date1         date2
607     *
608     *         2450123.7           0.0       (JD method)
609     *         2451545.0       -1421.3       (J2000 method)
610     *         2400000.5       50123.2       (MJD method)
611     *         2450123.5           0.2       (date &amp;time method)
612     *</pre>
613     *     The JD method is the most natural and convenient to use in
614     *     cases where the loss of several decimal digits of resolution
615     *     is acceptable.  The J2000 method is best matched to the way
616     *     the argument is handled internally and will deliver the
617     *     optimum resolution.  The MJD method and the date &amp;time methods
618     *     are both good compromises between resolution and convenience.
619     *
620     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
621     *     applying frame bias.
622     *
623     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
624     *     equinox to mean equator and equinox of date by applying
625     *     precession.
626     *
627     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
628     *     equinox of date by applying frame bias then precession.  It is
629     *     the product rp x rb.
630     *
631     * <li> It is permissible to re-use the same array in the returned
632     *     arguments.  The arrays are filled in the order given.
633     *</ol>
634     *<p>Called:<ul>
635     *     <li>{@link #jauBi00} frame bias components, IAU 2000
636     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
637     *     <li>{@link #jauIr} initialize r-matrix to identity
638     *     <li>{@link #jauRx} rotate around X-axis
639     *     <li>{@link #jauRy} rotate around Y-axis
640     *     <li>{@link #jauRz} rotate around Z-axis
641     *     <li>{@link #jauCr} copy r-matrix
642     *     <li>{@link #jauRxr} product of two r-matrices
643     * </ul>
644     *<p>Reference:
645     *     "Expressions for the Celestial Intermediate Pole and Celestial
646     *     Ephemeris Origin consistent with the IAU 2000A precession-
647     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
648     *
649     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
650     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
651     *
652     *@version 2010 January 18
653     *
654     *  @since Release 20101201
655     *
656     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
657     */
658     public static void jauBp00(final double  date1, final double date2,
659             double rb[][], double rp[][], double rbp[][])
660     {
661     /* J2000.0 obliquity (Lieske et al. 1977) */
662        final double EPS0 = 84381.448 * DAS2R;
663 
664        double t, dpsibi, depsbi;
665        double dra0, psia77, oma77, chia, dpsipr, depspr, psia, oma,
666               rbw[][] = new double[3][3];
667 
668 
669     /* Interval between fundamental epoch J2000.0 and current date (JC). */
670        t = ((date1 - DJ00) + date2) / DJC;
671 
672     /* Frame bias. */
673        FrameBias fb = jauBi00();
674        dpsibi = fb.dpsibi;
675        depsbi = fb.depsbi;
676        dra0 = fb.dra;
677     /* Precession angles (Lieske et al. 1977) */
678        psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * DAS2R;
679        oma77  =       EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * DAS2R;
680        chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
681 
682     /* Apply IAU 2000 precession corrections. */
683        PrecessionDeltaTerms pc = jauPr00(date1, date2);
684        dpsipr = pc.dpsipr;  depspr = pc.depspr;
685        psia = psia77 + dpsipr;
686        oma  = oma77  + depspr;
687 
688     /* Frame bias matrix: GCRS to J2000.0. */
689        jauIr(rbw);
690        jauRz(dra0, rbw);
691        jauRy(dpsibi * sin(EPS0), rbw);
692        jauRx(-depsbi, rbw);
693        jauCr(rbw, rb);
694 
695     /* Precession matrix: J2000.0 to mean of date. */
696        jauIr(rp);
697        jauRx(EPS0,  rp);
698        jauRz(-psia, rp);
699        jauRx(-oma,  rp);
700        jauRz(chia,  rp);
701 
702     /* Bias-precession matrix: GCRS to mean of date. */
703        double[][] rt = jauRxr(rp, rbw );
704        jauCr(rt, rbp);
705        return;
706 
707         }
708     
709 
710     /**
711     *  Frame bias and precession, IAU 2006.
712     *
713     *<p>This function is derived from the International Astronomical Union's
714     *  SOFA (Standards Of Fundamental Astronomy) software collection.
715     *
716     *<p>Status:  support function.
717     *
718     *<!-- Given: -->
719     *     @param date1 double TT as a 2-part Julian Date (Note 1)
720     *     @param date2 double TT as a 2-part Julian Date (Note 1)
721     *
722     *<!-- Returned: -->
723     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
724     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
725     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
726     *
727     * <p>Notes:
728     * <ol>
729     *
730     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
731     *     convenient way between the two arguments.  For example,
732     *     JD(TT)=2450123.7 could be expressed in any of these ways,
733     *     among others:
734     *<pre>
735     *             date1         date2
736     *
737     *         2450123.7           0.0       (JD method)
738     *         2451545.0       -1421.3       (J2000 method)
739     *         2400000.5       50123.2       (MJD method)
740     *         2450123.5           0.2       (date &amp;time method)
741     *</pre>
742     *     The JD method is the most natural and convenient to use in
743     *     cases where the loss of several decimal digits of resolution
744     *     is acceptable.  The J2000 method is best matched to the way
745     *     the argument is handled internally and will deliver the
746     *     optimum resolution.  The MJD method and the date &amp;time methods
747     *     are both good compromises between resolution and convenience.
748     *
749     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
750     *     applying frame bias.
751     *
752     * <li> The matrix rp transforms vectors from mean J2000.0 to mean of
753     *     date by applying precession.
754     *
755     * <li> The matrix rbp transforms vectors from GCRS to mean of date by
756     *     applying frame bias then precession.  It is the product rp x rb.
757     * 
758     *  <li> It is permissible to re-use the same array in the returned
759     *        arguments.  The arrays are filled in the order given.
760     *</ol>
761     *<p>Called:<ul>
762     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
763     *     <li>{@link #jauFw2m} F-W angles to r-matrix
764     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
765     *     <li>{@link #jauTr} transpose r-matrix
766     *     <li>{@link #jauRxr} product of two r-matrices
767     * </ul>
768     *<p>References:
769     *
770     *     <p>Capitaine, N. &amp;Wallace, P.T., 2006, Astron.Astrophys. 450, 855
771     *
772     *     <p>Wallace, P.T. &amp;Capitaine, N., 2006, Astron.Astrophys. 459, 981
773     *
774     *@version 2009 December 17
775     *
776     *  @since Release 20101201
777     *
778     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
779     */
780         public static void jauBp06(final double date1, final double date2,
781                  double rb[][], double rp[][], double rbp[][])
782     {
783        double rbt[][];
784 
785 
786     /* B matrix. */
787        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
788        double[][] rt = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
789        jauCr(rt, rb);
790 
791     /* PxB matrix. */
792        rt = jauPmat06(date1, date2 );
793        jauCr(rt, rbp);
794 
795     /* P matrix. */
796        rbt = jauTr(rb);
797        rt = jauRxr(rbp, rbt);
798        jauCr(rt, rp);
799 
800        return;
801 
802         }
803     
804      /**
805      * The components x,y are components of the Celestial Intermediate
806      *     Pole unit vector in the Geocentric Celestial Reference System.
807      *     
808      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Jan 2010
809      * 
810      * @since AIDA Stage 1
811      */
812     public static class CelestialIntermediatePole {
813          public double x; 
814          public double y;
815          public CelestialIntermediatePole(double x, double y) {
816             this.x = x;
817             this.y = y;
818         }
819      }
820     /**
821     *  Extract from the bias-precession-nutation matrix the X,Y coordinates
822     *  of the Celestial Intermediate Pole.
823     *
824     *<p>This function is derived from the International Astronomical Union's
825     *  SOFA (Standards Of Fundamental Astronomy) software collection.
826     *
827     *<p>Status:  support function.
828     *
829     *<!-- Given: -->
830     *     @param rbpn       double[3][3]   celestial-to-true matrix (Note 1)
831     *
832     *<!-- Returned: -->
833     *     @return     <u>returned</u> Celestial Intermediate Pole (Note 2)
834     *
835     * <p>Notes:
836     * <ol>
837     *
838     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
839     *     CIO or equinox) of date, and therefore the Celestial Intermediate
840     *     Pole unit vector is the bottom row of the matrix.
841     *
842     * <li> The arguments x,y are components of the Celestial Intermediate
843     *     Pole unit vector in the Geocentric Celestial Reference System.
844     *</ol>
845     *<p>Reference:
846     *
847     *     "Expressions for the Celestial Intermediate Pole and Celestial
848     *     Ephemeris Origin consistent with the IAU 2000A precession-
849     *     nutation model", Astron.Astrophys. 400, 1145-1154
850     *     (2003)
851     *
852     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
853     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
854     *
855     *@version 2010 January 18
856     *
857     *  @since Release 20101201
858     *
859     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
860     */
861         public static CelestialIntermediatePole  jauBpn2xy(double rbpn[][])
862     {
863     /* Extract the X,Y coordinates. */
864 
865        return new CelestialIntermediatePole(rbpn[2][0], rbpn[2][1]);
866 
867         }
868     
869 
870     /**
871     *  Form the celestial-to-intermediate matrix for a given date using the
872     *  IAU 2000A precession-nutation model.
873     *
874     *<p>This function is derived from the International Astronomical Union's
875     *  SOFA (Standards Of Fundamental Astronomy) software collection.
876     *
877     *<p>Status:  support function.
878     *
879     *<!-- Given: -->
880     *     @param date1 double TT as a 2-part Julian Date (Note 1)
881     *     @param date2 double TT as a 2-part Julian Date (Note 1)
882     *
883     *<!-- Returned: -->
884     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
885     *
886     * <p>Notes:
887     * <ol>
888     *
889     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
890     *     convenient way between the two arguments.  For example,
891     *     JD(TT)=2450123.7 could be expressed in any of these ways,
892     *     among others:
893     *<pre>
894     *            date1          date2
895     *
896     *         2450123.7           0.0       (JD method)
897     *         2451545.0       -1421.3       (J2000 method)
898     *         2400000.5       50123.2       (MJD method)
899     *         2450123.5           0.2       (date &amp;time method)
900     *</pre>
901     *     The JD method is the most natural and convenient to use in
902     *     cases where the loss of several decimal digits of resolution
903     *     is acceptable.  The J2000 method is best matched to the way
904     *     the argument is handled internally and will deliver the
905     *     optimum resolution.  The MJD method and the date &amp;time methods
906     *     are both good compromises between resolution and convenience.
907     *
908     * <li> The matrix rc2i is the first stage in the transformation from
909     *     celestial to terrestrial coordinates:
910     *
911     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
912     *
913     *               =  rc2t * [CRS]
914     *
915     *     where [CRS] is a vector in the Geocentric Celestial Reference
916     *     System and [TRS] is a vector in the International Terrestrial
917     *     Reference System (see IERS Conventions 2003), ERA is the Earth
918     *     Rotation Angle and RPOM is the polar motion matrix.
919     *
920     * <li> A faster, but slightly less accurate result (about 1 mas), can be
921     *     obtained by using instead the jauC2i00b function.
922     *</ol>
923     *<p>Called:<ul>
924     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
925     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
926     * </ul>
927     *<p>References:
928     *<ul>
929     *     <li>"Expressions for the Celestial Intermediate Pole and Celestial
930     *     Ephemeris Origin consistent with the IAU 2000A precession-
931     *     nutation model", Astron.Astrophys. 400, 1145-1154
932     *     (2003)
933     *
934     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
935     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
936     *
937     *    <li>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
938     *     IERS Technical Note No. 32, BKG (2004)
939     *</ul>
940     *@version 2010 January 18
941     *
942     *  @since Release 20101201
943     *
944     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
945     */
946     public static double[][] jauC2i00a(double date1, double date2)
947     {
948 
949 
950     /* Obtain the celestial-to-true matrix (IAU 2000A). */
951        double rbpn[][] = jauPnm00a(date1, date2);
952 
953     /* Form the celestial-to-intermediate matrix. */
954        double rc2i[][]  =jauC2ibpn(date1, date2, rbpn);
955 
956        return rc2i;
957 
958         }
959     
960 
961     /**
962     *  Form the celestial-to-intermediate matrix for a given date using the
963     *  IAU 2000B precession-nutation model.
964     *
965     *<p>This function is derived from the International Astronomical Union's
966     *  SOFA (Standards Of Fundamental Astronomy) software collection.
967     *
968     *<p>Status:  support function.
969     *
970     *<!-- Given: -->
971     *     @param date1 double TT as a 2-part Julian Date (Note 1)
972     *     @param date2 double TT as a 2-part Julian Date (Note 1)
973     *
974     *<!-- Returned: -->
975     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
976     *
977     * <p>Notes:
978     * <ol>
979     *
980     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
981     *     convenient way between the two arguments.  For example,
982     *     JD(TT)=2450123.7 could be expressed in any of these ways,
983     *     among others:
984     *<pre>
985     *            date1          date2
986     *
987     *         2450123.7           0.0       (JD method)
988     *         2451545.0       -1421.3       (J2000 method)
989     *         2400000.5       50123.2       (MJD method)
990     *         2450123.5           0.2       (date &amp;time method)
991     *</pre>
992     *     The JD method is the most natural and convenient to use in
993     *     cases where the loss of several decimal digits of resolution
994     *     is acceptable.  The J2000 method is best matched to the way
995     *     the argument is handled internally and will deliver the
996     *     optimum resolution.  The MJD method and the date &amp;time methods
997     *     are both good compromises between resolution and convenience.
998     *
999     * <li> The matrix rc2i is the first stage in the transformation from
1000     *     celestial to terrestrial coordinates:
1001     *
1002     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1003     *
1004     *               =  rc2t * [CRS]
1005     *
1006     *     where [CRS] is a vector in the Geocentric Celestial Reference
1007     *     System and [TRS] is a vector in the International Terrestrial
1008     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1009     *     Rotation Angle and RPOM is the polar motion matrix.
1010     *
1011     * <li> The present function is faster, but slightly less accurate (about
1012     *     1 mas), than the jauC2i00a function.
1013     *</ol>
1014     *<p>Called:<ul>
1015     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
1016     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
1017     * </ul>
1018     *<p>References:
1019     *
1020     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1021     *     Ephemeris Origin consistent with the IAU 2000A precession-
1022     *     nutation model", Astron.Astrophys. 400, 1145-1154
1023     *     (2003)
1024     *
1025     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1026     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1027     *
1028     *    <p> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1029     *     IERS Technical Note No. 32, BKG (2004)
1030     *
1031     *@version 2010 January 18
1032     *
1033     *  @since Release 20101201
1034     *
1035     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1036     */
1037     public static double[][] jauC2i00b(double date1, double date2)
1038     {
1039        double rbpn[][];
1040        double rc2i[][];
1041 
1042     /* Obtain the celestial-to-true matrix (IAU 2000B). */
1043        rbpn = jauPnm00b(date1, date2 );
1044 
1045     /* Form the celestial-to-intermediate matrix. */
1046        rc2i = jauC2ibpn(date1, date2, rbpn);
1047 
1048        return rc2i;
1049 
1050         }
1051     
1052 
1053     /**
1054     *  Form the celestial-to-intermediate matrix for a given date using the
1055     *  IAU 2006 precession and IAU 2000A nutation models.
1056     *
1057     *<p>This function is derived from the International Astronomical Union's
1058     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1059     *
1060     *<p>Status:  support function.
1061     *
1062     *<!-- Given: -->
1063     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1064     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1065     *
1066     *<!-- Returned: -->
1067     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
1068     *
1069     * <p>Notes:
1070     * <ol>
1071     *
1072     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1073     *     convenient way between the two arguments.  For example,
1074     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1075     *     among others:
1076     *<pre>
1077     *            date1          date2
1078     *
1079     *         2450123.7           0.0       (JD method)
1080     *         2451545.0       -1421.3       (J2000 method)
1081     *         2400000.5       50123.2       (MJD method)
1082     *         2450123.5           0.2       (date &amp;time method)
1083     *</pre>
1084     *     The JD method is the most natural and convenient to use in
1085     *     cases where the loss of several decimal digits of resolution
1086     *     is acceptable.  The J2000 method is best matched to the way
1087     *     the argument is handled internally and will deliver the
1088     *     optimum resolution.  The MJD method and the date &amp;time methods
1089     *     are both good compromises between resolution and convenience.
1090     *
1091     * <li> The matrix rc2i is the first stage in the transformation from
1092     *     celestial to terrestrial coordinates:
1093     *
1094     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1095     *
1096     *               =  RC2T * [CRS]
1097     *
1098     *     where [CRS] is a vector in the Geocentric Celestial Reference
1099     *     System and [TRS] is a vector in the International Terrestrial
1100     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1101     *     Rotation Angle and RPOM is the polar motion matrix.
1102     *</ol>
1103     *<p>Called:<ul>
1104     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
1105     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1106     *     <li>{@link #jauS06} the CIO locator s, Given X,Y, IAU 2006
1107     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, Given X,Y and s
1108     * </ul>
1109     *<p>References:
1110     *
1111     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1112     *     IERS Technical Note No. 32, BKG
1113     *
1114     *@version 2008 May 13
1115     *
1116     *  @since Release 20101201
1117     *
1118     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1119     */
1120     public static double[][] jauC2i06a(double date1, double date2)
1121     {
1122        double rbpn[][], s,  rc2i[][];
1123 
1124 
1125     /* Obtain the celestial-to-true matrix (IAU 2006/2000A). */
1126        rbpn = jauPnm06a(date1, date2);
1127 
1128     /* Extract the X,Y coordinates. */
1129        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1130 
1131     /* Obtain the CIO locator. */
1132        s = jauS06(date1, date2, cip.x, cip.y);
1133 
1134     /* Form the celestial-to-intermediate matrix. */
1135        rc2i = jauC2ixys(cip.x, cip.y, s);
1136 
1137        return rc2i;
1138 
1139         }
1140     
1141 
1142     /**
1143     *  Form the celestial-to-intermediate matrix for a given date given
1144     *  the bias-precession-nutation matrix.  IAU 2000.
1145     *
1146     *<p>This function is derived from the International Astronomical Union's
1147     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1148     *
1149     *<p>Status:  support function.
1150     *
1151     *<!-- Given: -->
1152     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1153     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1154     *     @param rbpn         double[3][3]  celestial-to-true matrix (Note 2)
1155     *
1156     *<!-- Returned: -->
1157     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1158     *
1159     * <p>Notes:
1160     * <ol>
1161     *
1162     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1163     *     convenient way between the two arguments.  For example,
1164     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1165     *     among others:
1166     *<pre>
1167     *            date1          date2
1168     *
1169     *         2450123.7           0.0       (JD method)
1170     *         2451545.0       -1421.3       (J2000 method)
1171     *         2400000.5       50123.2       (MJD method)
1172     *         2450123.5           0.2       (date &amp;time method)
1173     *</pre>
1174     *     The JD method is the most natural and convenient to use in
1175     *     cases where the loss of several decimal digits of resolution
1176     *     is acceptable.  The J2000 method is best matched to the way
1177     *     the argument is handled internally and will deliver the
1178     *     optimum resolution.  The MJD method and the date &amp;time methods
1179     *     are both good compromises between resolution and convenience.
1180     *
1181     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
1182     *     CIO or equinox) of date.  Only the CIP (bottom row) is used.
1183     *
1184     * <li> The matrix rc2i is the first stage in the transformation from
1185     *     celestial to terrestrial coordinates:
1186     *
1187     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1188     *
1189     *              = RC2T * [CRS]
1190     *
1191     *     where [CRS] is a vector in the Geocentric Celestial Reference
1192     *     System and [TRS] is a vector in the International Terrestrial
1193     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1194     *     Rotation Angle and RPOM is the polar motion matrix.
1195     *
1196     * <li> Although its name does not include "00", This function is in fact
1197     *     specific to the IAU 2000 models.
1198     *</ol>
1199     *<p>Called:<ul>
1200     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1201     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
1202     * </ul>
1203     *<p>References:
1204     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1205     *     Ephemeris Origin consistent with the IAU 2000A precession-
1206     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
1207     *
1208     *     <p>n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1209     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1210     *
1211     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1212     *     IERS Technical Note No. 32, BKG (2004)
1213     *
1214     *@version 2010 January 18
1215     *
1216     *  @since Release 20101201
1217     *
1218     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1219     */
1220     public static double[][] jauC2ibpn(double date1, double date2, double rbpn[][])
1221     {
1222 
1223     /* Extract the X,Y coordinates. */
1224        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1225        
1226        
1227     /* Form the celestial-to-intermediate matrix (n.b. IAU 2000 specific). */
1228        double rc2i[][] =jauC2ixy(date1, date2, cip.x, cip.y);
1229 
1230        return rc2i;
1231 
1232         }
1233     
1234 
1235     /**
1236     *  Form the celestial to intermediate-frame-of-date matrix for a given
1237     *  date when the CIP X,Y coordinates are known.  IAU 2000.
1238     *
1239     *<p>This function is derived from the International Astronomical Union's
1240     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1241     *
1242     *<p>Status:  support function.
1243     *
1244     *<!-- Given: -->
1245     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1246     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1247     *     @param x double        Celestial Intermediate Pole (Note 2)
1248     *     @param y double        Celestial Intermediate Pole (Note 2) 
1249     *
1250     *<!-- Returned: -->
1251     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1252     *
1253     * <p>Notes:
1254     * <ol>
1255     *
1256     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1257     *     convenient way between the two arguments.  For example,
1258     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1259     *     among others:
1260     *<pre>
1261     *            date1          date2
1262     *
1263     *         2450123.7           0.0       (JD method)
1264     *         2451545.0       -1421.3       (J2000 method)
1265     *         2400000.5       50123.2       (MJD method)
1266     *         2450123.5           0.2       (date &amp;time method)
1267     *</pre>
1268     *     The JD method is the most natural and convenient to use in
1269     *     cases where the loss of several decimal digits of resolution
1270     *     is acceptable.  The J2000 method is best matched to the way
1271     *     the argument is handled internally and will deliver the
1272     *     optimum resolution.  The MJD method and the date &amp;time methods
1273     *     are both good compromises between resolution and convenience.
1274     *
1275     * <li> The Celestial Intermediate Pole coordinates are the x,y components
1276     *     of the unit vector in the Geocentric Celestial Reference System.
1277     *
1278     * <li> The matrix rc2i is the first stage in the transformation from
1279     *     celestial to terrestrial coordinates:
1280     *
1281     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1282     *
1283     *              = RC2T * [CRS]
1284     *
1285     *     where [CRS] is a vector in the Geocentric Celestial Reference
1286     *     System and [TRS] is a vector in the International Terrestrial
1287     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1288     *     Rotation Angle and RPOM is the polar motion matrix.
1289     *
1290     * <li> Although its name does not include "00", This function is in fact
1291     *     specific to the IAU 2000 models.
1292     *</ol>
1293     *<p>Called:<ul>
1294     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
1295     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
1296     * </ul>
1297     *<p>Reference:
1298     *
1299     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1300     *     IERS Technical Note No. 32, BKG (2004)
1301     *
1302     *@version 2008 May 11
1303     *
1304     *  @since Release 20101201
1305     *
1306     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1307     */
1308 
1309     public static  double[][] jauC2ixy(double date1, double date2, double x, double y)
1310     {
1311     /* Compute s and then the matrix. */
1312        double rc2i[][] = jauC2ixys(x, y, jauS00(date1, date2, x, y));
1313 
1314        return rc2i;
1315 
1316         }
1317     
1318 
1319     /**
1320     *  Form the celestial to intermediate-frame-of-date matrix given the CIP
1321     *  X,Y and the CIO locator s.
1322     *
1323     *<p>This function is derived from the International Astronomical Union's
1324     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1325     *
1326     *<p>Status:  support function.
1327     *
1328     *<!-- Given: -->
1329     *     @param x double          Celestial Intermediate Pole (Note 1)
1330     *     @param y double          Celestial Intermediate Pole (Note 1) 
1331     *     @param s         double          the CIO locator s (Note 2)
1332     *
1333     *<!-- Returned: -->
1334     *     @return rc2i      double[3][3]     <u>returned</u> celestial-to-intermediate matrix (Note 3)
1335     *
1336     * <p>Notes:
1337     * <ol>
1338     *
1339     * <li> The Celestial Intermediate Pole coordinates are the x,y
1340     *     components of the unit vector in the Geocentric Celestial
1341     *     Reference System.
1342     *
1343     * <li> The CIO locator s (in radians) positions the Celestial
1344     *     Intermediate Origin on the equator of the CIP.
1345     *
1346     * <li> The matrix rc2i is the first stage in the transformation from
1347     *     celestial to terrestrial coordinates:
1348     *
1349     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1350     *
1351     *              = RC2T * [CRS]
1352     *
1353     *     where [CRS] is a vector in the Geocentric Celestial Reference
1354     *     System and [TRS] is a vector in the International Terrestrial
1355     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1356     *     Rotation Angle and RPOM is the polar motion matrix.
1357     *</ol>
1358     *<p>Called:<ul>
1359     *     <li>{@link #jauIr} initialize r-matrix to identity
1360     *     <li>{@link #jauRz} rotate around Z-axis
1361     *     <li>{@link #jauRy} rotate around Y-axis
1362     * </ul>
1363     *<p>Reference:
1364     *
1365     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1366     *     IERS Technical Note No. 32, BKG (2004)
1367     *
1368     *@version 2008 May 11
1369     *
1370     *  @since Release 20101201
1371     *
1372     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1373     */
1374     public static double[][] jauC2ixys(double x, double y, double s)
1375     {
1376        double r2, e, d;
1377        double rc2i[][] = new double[3][3];
1378 
1379     /* Obtain the spherical angles E and d. */
1380        r2 = x*x + y*y;
1381        e = (r2 > 0.0) ? atan2(y, x) : 0.0;
1382        d = atan(sqrt(r2 / (1.0 - r2)));
1383 
1384     /* Form the matrix. */
1385        jauIr(rc2i);
1386        jauRz(e, rc2i);
1387        jauRy(d, rc2i);
1388        jauRz(-(e+s), rc2i);
1389 
1390        return rc2i;
1391 
1392         }
1393     
1394     /**
1395     *  P-vector to spherical coordinates.
1396     *
1397     *<p>This function is derived from the International Astronomical Union's
1398     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1399     *
1400     *<p>Status:  vector/matrix support function.
1401     *
1402     *<!-- Given: -->
1403     *     @param p       double[3]     p-vector
1404     *
1405     *<!-- Returned: -->
1406     *     @return theta   double         <u>returned</u> longitude angle (radians)
1407     *             phi     double         <u>returned</u> latitude angle (radians)
1408     *
1409     * <p>Notes:
1410     * <ol>
1411     *
1412     * <li> The vector p can have any magnitude; only its direction is used.
1413     *
1414     * <li> If p is null, zero theta and phi are returned.
1415     *
1416     * <li> At either pole, zero theta is returned.
1417     *</ol>
1418     *@version 2008 May 11
1419     *
1420     *  @since Release 20101201
1421     *
1422     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1423     */
1424     public static SphericalCoordinate jauC2s(double p[])
1425     {
1426        double x, y, z, d2;
1427 
1428 
1429        x  = p[0];
1430        y  = p[1];
1431        z  = p[2];
1432        d2 = x*x + y*y;
1433 
1434        double theta = (d2 == 0.0) ? 0.0 : atan2(y, x);
1435        double phi = (z == 0.0) ? 0.0 : atan2(z, sqrt(d2));
1436 
1437        return new SphericalCoordinate(theta, phi);
1438 
1439         }
1440     
1441 
1442     /**
1443     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1444     *  the polar motion, using the IAU 2000A nutation model.
1445     *
1446     *<p>This function is derived from the International Astronomical Union's
1447     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1448     *
1449     *<p>Status:  support function.
1450     *
1451     *<!-- Given: -->
1452     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1453     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1454     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1455     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1456     *     @param xp double          coordinates of the pole (radians, Note 2)
1457     *     @param yp double          coordinates of the pole (radians, Note 2) 
1458     *
1459     *<!-- Returned: -->
1460     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1461     *
1462     * <p>Notes:
1463     * <ol>
1464     *
1465     *   <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1466     *     apportioned in any convenient way between the arguments uta and
1467     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1468     *     these ways, among others:
1469     *<pre>
1470     *             uta            utb
1471     *
1472     *         2450123.7           0.0       (JD method)
1473     *         2451545.0       -1421.3       (J2000 method)
1474     *         2400000.5       50123.2       (MJD method)
1475     *         2450123.5           0.2       (date &amp;time method)
1476     *</pre>
1477     *     The JD method is the most natural and convenient to use in
1478     *     cases where the loss of several decimal digits of resolution is
1479     *     acceptable.  The J2000 and MJD methods are good compromises
1480     *     between resolution and convenience.  In the case of uta,utb, the
1481     *     date &amp;time method is best matched to the Earth rotation angle
1482     *     algorithm used:  maximum precision is delivered when the uta
1483     *     argument is for 0hrs UT1 on the day in question and the utb
1484     *     argument lies in the range 0 to 1, or vice versa.
1485     *
1486     *  <li> The arguments xp and yp are the coordinates (in radians) of the
1487     *     Celestial Intermediate Pole with respect to the International
1488     *     Terrestrial Reference System (see IERS Conventions 2003),
1489     *     measured along the meridians to 0 and 90 deg west respectively.
1490     *
1491     * <li> The matrix rc2t transforms from celestial to terrestrial
1492     *     coordinates:
1493     *
1494     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1495     *
1496     *              = rc2t * [CRS]
1497     *
1498     *     where [CRS] is a vector in the Geocentric Celestial Reference
1499     *     System and [TRS] is a vector in the International Terrestrial
1500     *     Reference System (see IERS Conventions 2003), RC2I is the
1501     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1502     *     angle and RPOM is the polar motion matrix.
1503     *
1504     * <li> A faster, but slightly less accurate result (about 1 mas), can
1505     *     be obtained by using instead the jauC2t00b function.
1506     *</ol>
1507     *<p>Called:<ul>
1508     *     <li>{@link #jauC2i00a} celestial-to-intermediate matrix, IAU 2000A
1509     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1510     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1511     *     <li>{@link #jauPom00} polar motion matrix
1512     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1513     * </ul>
1514     *<p>Reference:
1515     *
1516     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1517     *     IERS Technical Note No. 32, BKG (2004)
1518     *
1519     *@version 2009 April 1
1520     *
1521     *  @since Release 20101201
1522     *
1523     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1524     */
1525     public static  double[][] jauC2t00a(final double tta, final double ttb, final double uta, final double utb,
1526                    final double xp, final double yp)
1527     {
1528        double rc2i[][]= new double[3][3], era, sp, rpom[][];
1529 
1530 
1531     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000A). */
1532        rc2i = jauC2i00a(tta, ttb);
1533 
1534     /* Predict the Earth rotation angle for this UT1. */
1535        era = jauEra00(uta, utb);
1536 
1537     /* Estimate s'. */
1538        sp = jauSp00(tta, ttb);
1539 
1540     /* Form the polar motion matrix. */
1541        rpom = jauPom00(xp, yp, sp );
1542 
1543     /* Combine to form the celestial-to-terrestrial matrix. */
1544        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
1545 
1546        return rc2t;
1547 
1548         }
1549     
1550 
1551     /**
1552     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1553     *  the polar motion, using the IAU 2000B nutation model.
1554     *
1555     *<p>This function is derived from the International Astronomical Union's
1556     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1557     *
1558     *<p>Status:  support function.
1559     *
1560     *<!-- Given: -->
1561     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1562     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1563     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1564     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1565     *     @param xp double          coordinates of the pole (radians, Note 2)
1566     *     @param yp double          coordinates of the pole (radians, Note 2) 
1567     *
1568     *<!-- Returned: -->
1569     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1570     *
1571     * <p>Notes:
1572     * <ol>
1573     *
1574     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1575     *     apportioned in any convenient way between the arguments uta and
1576     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1577     *     these ways, among others:
1578     *<pre>
1579     *             uta            utb
1580     *
1581     *         2450123.7           0.0       (JD method)
1582     *         2451545.0       -1421.3       (J2000 method)
1583     *         2400000.5       50123.2       (MJD method)
1584     *         2450123.5           0.2       (date &amp;time method)
1585     *</pre>
1586     *     The JD method is the most natural and convenient to use in
1587     *     cases where the loss of several decimal digits of resolution is
1588     *     acceptable.  The J2000 and MJD methods are good compromises
1589     *     between resolution and convenience.  In the case of uta,utb, the
1590     *     date &amp;time method is best matched to the Earth rotation angle
1591     *     algorithm used:  maximum precision is delivered when the uta
1592     *     argument is for 0hrs UT1 on the day in question and the utb
1593     *     argument lies in the range 0 to 1, or vice versa.
1594     *
1595     * <li> The arguments xp and yp are the coordinates (in radians) of the
1596     *     Celestial Intermediate Pole with respect to the International
1597     *     Terrestrial Reference System (see IERS Conventions 2003),
1598     *     measured along the meridians to 0 and 90 deg west respectively.
1599     *
1600     * <li> The matrix rc2t transforms from celestial to terrestrial
1601     *     coordinates:
1602     *
1603     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1604     *
1605     *              = rc2t * [CRS]
1606     *
1607     *     where [CRS] is a vector in the Geocentric Celestial Reference
1608     *     System and [TRS] is a vector in the International Terrestrial
1609     *     Reference System (see IERS Conventions 2003), RC2I is the
1610     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1611     *     angle and RPOM is the polar motion matrix.
1612     *
1613     * <li> The present function is faster, but slightly less accurate (about
1614     *     1 mas), than the jauC2t00a function.
1615     *</ol>
1616     *<p>Called:<ul>
1617     *     <li>{@link #jauC2i00b} celestial-to-intermediate matrix, IAU 2000B
1618     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1619     *     <li>{@link #jauPom00} polar motion matrix
1620     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1621     * </ul>
1622     *<p>Reference:
1623     *
1624     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1625     *     IERS Technical Note No. 32, BKG (2004)
1626     *
1627     *@version 2009 April 1
1628     *
1629     *  @since Release 20101201
1630     *
1631     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1632     */
1633     public static double[][] jauC2t00b(final double tta, final double ttb, final double uta, final double utb,
1634                    final double xp, final double yp )
1635     {
1636        double rc2i[][], era, rpom[][];
1637        double rc2t[][];
1638 
1639     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */
1640        rc2i =jauC2i00b(tta, ttb);
1641 
1642     /* Predict the Earth rotation angle for this UT1. */
1643        era = jauEra00(uta, utb);
1644 
1645     /* Form the polar motion matrix (neglecting s'). */
1646        rpom = jauPom00(xp, yp, 0.0 );
1647 
1648     /* Combine to form the celestial-to-terrestrial matrix. */
1649        rc2t = jauC2tcio(rc2i, era, rpom );
1650 
1651        return rc2t;
1652 
1653         }
1654     
1655 
1656     /**
1657     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1658     *  the polar motion, using the IAU 2006 precession and IAU 2000A
1659     *  nutation models.
1660     *
1661     *<p>This function is derived from the International Astronomical Union's
1662     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1663     *
1664     *<p>Status:  support function.
1665     *
1666     *<!-- Given: -->
1667     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1668     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1669     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1670     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1671     *     @param xp double          coordinates of the pole (radians, Note 2)
1672     *     @param yp double          coordinates of the pole (radians, Note 2) 
1673     *
1674     *<!-- Returned: -->
1675     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1676     *
1677     * <p>Notes:
1678     * <ol>
1679     *
1680     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1681     *     apportioned in any convenient way between the arguments uta and
1682     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1683     *     these ways, among others:
1684     *<pre>
1685     *             uta            utb
1686     *
1687     *         2450123.7           0.0       (JD method)
1688     *         2451545.0       -1421.3       (J2000 method)
1689     *         2400000.5       50123.2       (MJD method)
1690     *         2450123.5           0.2       (date &amp;time method)
1691     *</pre>
1692     *     The JD method is the most natural and convenient to use in
1693     *     cases where the loss of several decimal digits of resolution is
1694     *     acceptable.  The J2000 and MJD methods are good compromises
1695     *     between resolution and convenience.  In the case of uta,utb, the
1696     *     date &amp;time method is best matched to the Earth rotation angle
1697     *     algorithm used:  maximum precision is delivered when the uta
1698     *     argument is for 0hrs UT1 on the day in question and the utb
1699     *     argument lies in the range 0 to 1, or vice versa.
1700     *
1701     * <li> The arguments xp and yp are the coordinates (in radians) of the
1702     *     Celestial Intermediate Pole with respect to the International
1703     *     Terrestrial Reference System (see IERS Conventions 2003),
1704     *     measured along the meridians to 0 and 90 deg west respectively.
1705     *
1706     * <li> The matrix rc2t transforms from celestial to terrestrial
1707     *     coordinates:
1708     *
1709     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1710     *
1711     *              = rc2t * [CRS]
1712     *
1713     *     where [CRS] is a vector in the Geocentric Celestial Reference
1714     *     System and [TRS] is a vector in the International Terrestrial
1715     *     Reference System (see IERS Conventions 2003), RC2I is the
1716     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1717     *     angle and RPOM is the polar motion matrix.
1718     *</ol>
1719     *<p>Called:<ul>
1720     *     <li>{@link #jauC2i06a} celestial-to-intermediate matrix, IAU 2006/2000A
1721     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1722     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1723     *     <li>{@link #jauPom00} polar motion matrix
1724     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1725     * </ul>
1726     *<p>Reference:
1727     *
1728     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1729     *     IERS Technical Note No. 32, BKG
1730     *
1731     *@version 2009 April 1
1732     *
1733     *  @since Release 20101201
1734     *
1735     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1736     */
1737     public static double[][] jauC2t06a(final double tta, final double ttb, final double uta, final double utb,
1738                   final double xp, final double yp)
1739     {
1740        double rc2i[][], era, sp, rpom[][], rc2t[][];
1741 
1742 
1743     /* Form the celestial-to-intermediate matrix for this TT. */
1744        rc2i = jauC2i06a(tta, ttb);
1745 
1746     /* Predict the Earth rotation angle for this UT1. */
1747        era = jauEra00(uta, utb);
1748 
1749     /* Estimate s'. */
1750        sp = jauSp00(tta, ttb);
1751 
1752     /* Form the polar motion matrix. */
1753        rpom = jauPom00(xp, yp, sp );
1754 
1755     /* Combine to form the celestial-to-terrestrial matrix. */
1756        rc2t = jauC2tcio(rc2i, era, rpom );
1757 
1758        return rc2t;
1759 
1760         }
1761     
1762 
1763     /**
1764     *  Assemble the celestial to terrestrial matrix from CIO-based
1765     *  components (the celestial-to-intermediate matrix, the Earth Rotation
1766     *  Angle and the polar motion matrix).
1767     *
1768     *<p>This function is derived from the International Astronomical Union's
1769     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1770     *
1771     *<p>Status:  support function.
1772     *
1773     *<!-- Given: -->
1774     *     @param rc2i      double[3][3]     celestial-to-intermediate matrix
1775     *     @param era       double           Earth rotation angle (radians)
1776     *     @param rpom      double[3][3]     polar-motion matrix
1777     *
1778     *<!-- Returned: -->
1779     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix
1780     *
1781     * <p>Notes:
1782     * <ol>
1783     *
1784     * <li> This function constructs the rotation matrix that transforms
1785     *     vectors in the celestial system into vectors in the terrestrial
1786     *     system.  It does so starting from precomputed components, namely
1787     *     the matrix which rotates from celestial coordinates to the
1788     *     intermediate frame, the Earth rotation angle and the polar motion
1789     *     matrix.  One use of the present function is when generating a
1790     *     series of celestial-to-terrestrial matrices where only the Earth
1791     *     Rotation Angle changes, avoiding the considerable overhead of
1792     *     recomputing the precession-nutation more often than necessary to
1793     *     achieve given accuracy objectives.
1794     *
1795     * <li> The relationship between the arguments is as follows:
1796     *
1797     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1798     *
1799     *              = rc2t * [CRS]
1800     *
1801     *     where [CRS] is a vector in the Geocentric Celestial Reference
1802     *     System and [TRS] is a vector in the International Terrestrial
1803     *     Reference System (see IERS Conventions 2003).
1804     *</ol>
1805     *<p>Called:<ul>
1806     *     <li>{@link #jauCr} copy r-matrix
1807     *     <li>{@link #jauRz} rotate around Z-axis
1808     *     <li>{@link #jauRxr} product of two r-matrices
1809     * </ul>
1810     *<p>Reference:
1811     *
1812     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1813     *     IERS Technical Note No. 32, BKG
1814     *
1815     *@version 2008 May 11
1816     *
1817     *  @since Release 20101201
1818     *
1819     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1820     */
1821     public static double[][] jauC2tcio(final double rc2i[][], final double era, final double rpom[][])
1822     {
1823        double r[][] = new double[3][3];
1824 
1825 
1826     /* Construct the matrix. */
1827        jauCr(rc2i, r);
1828        jauRz(era, r);
1829        double[][] rc2t = jauRxr(rpom, r);
1830 
1831        return rc2t;
1832 
1833         }
1834     
1835 
1836     /**
1837     *  Assemble the celestial to terrestrial matrix from equinox-based
1838     *  components (the celestial-to-true matrix, the Greenwich Apparent
1839     *  Sidereal Time and the polar motion matrix).
1840     *
1841     *<p>This function is derived from the International Astronomical Union's
1842     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1843     *
1844     *<p>Status:  support function.
1845     *
1846     *<!-- Given: -->
1847     *     @param rbpn      double[3][3]     celestial-to-true matrix
1848     *     @param gst       double           Greenwich (apparent) Sidereal Time (radians)
1849     *     @param rpom      double[3][3]     polar-motion matrix
1850     *
1851     *<!-- Returned: -->
1852     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix (Note 2)
1853     *
1854     * <p>Notes:
1855     * <ol>
1856     *
1857     * <li> This function constructs the rotation matrix that transforms
1858     *     vectors in the celestial system into vectors in the terrestrial
1859     *     system.  It does so starting from precomputed components, namely
1860     *     the matrix which rotates from celestial coordinates to the
1861     *     true equator and equinox of date, the Greenwich Apparent Sidereal
1862     *     Time and the polar motion matrix.  One use of the present function
1863     *     is when generating a series of celestial-to-terrestrial matrices
1864     *     where only the Sidereal Time changes, avoiding the considerable
1865     *     overhead of recomputing the precession-nutation more often than
1866     *     necessary to achieve given accuracy objectives.
1867     *
1868     * <li> The relationship between the arguments is as follows:
1869     *
1870     *        [TRS] = rpom * R_3(gst) * rbpn * [CRS]
1871     *
1872     *              = rc2t * [CRS]
1873     *
1874     *     where [CRS] is a vector in the Geocentric Celestial Reference
1875     *     System and [TRS] is a vector in the International Terrestrial
1876     *     Reference System (see IERS Conventions 2003).
1877     *</ol>
1878     *<p>Called:<ul>
1879     *     <li>{@link #jauCr} copy r-matrix
1880     *     <li>{@link #jauRz} rotate around Z-axis
1881     *     <li>{@link #jauRxr} product of two r-matrices
1882     * </ul>
1883     *<p>Reference:
1884     *
1885     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1886     *     IERS Technical Note No. 32, BKG (2004)
1887     *
1888     *@version 2008 May 11
1889     *
1890     *  @since Release 20101201
1891     *
1892     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1893     */
1894     public static double[][] jauC2teqx(final double rbpn[][], final double gst, final double rpom[][] )
1895     {
1896        double r[][] = new double[3][3], rc2t[][];
1897 
1898 
1899     /* Construct the matrix. */
1900        jauCr(rbpn, r);
1901        jauRz(gst, r);
1902        rc2t = jauRxr(rpom, r);
1903 
1904        return rc2t;
1905 
1906         }
1907     
1908 
1909     /**
1910     *  Form the celestial to terrestrial matrix given the date, the UT1,
1911     *  the nutation and the polar motion.  IAU 2000.
1912     *
1913     *<p>This function is derived from the International Astronomical Union's
1914     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1915     *
1916     *<p>Status:  support function.
1917     *
1918     *<!-- Given: -->
1919     *     @param tta double         TT as a 2-part Julian Date (Note 1)
1920     *     @param ttb double         TT as a 2-part Julian Date (Note 1) 
1921     *     @param uta double         UT1 as a 2-part Julian Date (Note 1)
1922     *     @param utb double         UT1 as a 2-part Julian Date (Note 1) 
1923     *     @param dpsi double         nutation (Note 2)
1924     *     @param deps double         nutation (Note 2) 
1925     *     @param xp double         coordinates of the pole (radians, Note 3)
1926     *     @param yp double         coordinates of the pole (radians, Note 3) 
1927     *
1928     *<!-- Returned: -->
1929     *     @return rc2t        double[3][3]    <u>returned</u> celestial-to-terrestrial matrix (Note 4)
1930     *
1931     * <p>Notes:
1932     * <ol>
1933     *
1934     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1935     *     apportioned in any convenient way between the arguments uta and
1936     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1937     *     these ways, among others:
1938     *<pre>
1939     *             uta            utb
1940     *
1941     *         2450123.7           0.0       (JD method)
1942     *         2451545.0       -1421.3       (J2000 method)
1943     *         2400000.5       50123.2       (MJD method)
1944     *         2450123.5           0.2       (date &amp;time method)
1945     *</pre>
1946     *     The JD method is the most natural and convenient to use in
1947     *     cases where the loss of several decimal digits of resolution is
1948     *     acceptable.  The J2000 and MJD methods are good compromises
1949     *     between resolution and convenience.  In the case of uta,utb, the
1950     *     date &amp;time method is best matched to the Earth rotation angle
1951     *     algorithm used:  maximum precision is delivered when the uta
1952     *     argument is for 0hrs UT1 on the day in question and the utb
1953     *     argument lies in the range 0 to 1, or vice versa.
1954     *
1955     * <li> The caller is responsible for providing the nutation components;
1956     *     they are in longitude and obliquity, in radians and are with
1957     *     respect to the equinox and ecliptic of date.  For high-accuracy
1958     *     applications, free core nutation should be included as well as
1959     *     any other relevant corrections to the position of the CIP.
1960     *
1961     * <li> The arguments xp and yp are the coordinates (in radians) of the
1962     *     Celestial Intermediate Pole with respect to the International
1963     *     Terrestrial Reference System (see IERS Conventions 2003),
1964     *     measured along the meridians to 0 and 90 deg west respectively.
1965     *
1966     * <li> The matrix rc2t transforms from celestial to terrestrial
1967     *     coordinates:
1968     *
1969     *        [TRS] = RPOM * R_3(GST) * RBPN * [CRS]
1970     *
1971     *              = rc2t * [CRS]
1972     *
1973     *     where [CRS] is a vector in the Geocentric Celestial Reference
1974     *     System and [TRS] is a vector in the International Terrestrial
1975     *     Reference System (see IERS Conventions 2003), RBPN is the
1976     *     bias-precession-nutation matrix, GST is the Greenwich (apparent)
1977     *     Sidereal Time and RPOM is the polar motion matrix.
1978     *
1979     * <li> Although its name does not include "00", This function is in fact
1980     *     specific to the IAU 2000 models.
1981     *</ol>
1982     *<p>Called:<ul>
1983     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
1984     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
1985     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1986     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
1987     *     <li>{@link #jauPom00} polar motion matrix
1988     *     <li>{@link #jauC2teqx} form equinox-based celestial-to-terrestrial matrix
1989     * </ul>
1990     *<p>Reference:
1991     *
1992     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1993     *     IERS Technical Note No. 32, BKG (2004)
1994     *
1995     *@version 2009 April 1
1996     *
1997     *  @since Release 20101201
1998     *
1999     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2000     */
2001     public static double[][] jauC2tpe(final double tta, final double ttb, final double uta, final double utb,
2002             final double dpsi, final double deps, final double xp, final double yp)
2003     {
2004        double rpom[][]; 
2005 
2006     /* Form the celestial-to-true matrix for this TT. */
2007        PrecessionNutation pn = jauPn00(tta, ttb, dpsi, deps);
2008 
2009     /* Predict the Greenwich Mean Sidereal Time for this UT1 and TT. */
2010        double gmst = jauGmst00(uta, utb, tta, ttb);
2011 
2012     /* Predict the equation of the equinoxes given TT and nutation. */
2013        double ee = jauEe00(tta, ttb, pn.epsa, dpsi);
2014 
2015     /* Estimate s'. */
2016        double sp = jauSp00(tta, ttb);
2017 
2018     /* Form the polar motion matrix. */
2019        rpom = jauPom00(xp, yp, sp);
2020 
2021     /* Combine to form the celestial-to-terrestrial matrix. */
2022        double[][] rc2t = jauC2teqx(pn.rbpn, gmst + ee, rpom );
2023 
2024        return rc2t;
2025 
2026         }
2027     
2028 
2029     /**
2030     *  Form the celestial to terrestrial matrix given the date, the UT1,
2031     *  the CIP coordinates and the polar motion.  IAU 2000.
2032     *
2033     *<p>This function is derived from the International Astronomical Union's
2034     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2035     *
2036     *<p>Status:  support function.
2037     *
2038     *<!-- Given: -->
2039     *     @param tta double          TT as a 2-part Julian Date (Note 1)
2040     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
2041     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
2042     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
2043     *     @param x double          Celestial Intermediate Pole (Note 2)
2044     *     @param y double          Celestial Intermediate Pole (Note 2) 
2045     *     @param xp double          coordinates of the pole (radians, Note 3)
2046     *     @param yp double          coordinates of the pole (radians, Note 3) 
2047     *
2048     *<!-- Returned: -->
2049     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 4)
2050     *
2051     * <p>Notes:
2052     * <ol>
2053     *
2054     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
2055     *     apportioned in any convenient way between the arguments uta and
2056     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any o
2057     *     these ways, among others:
2058     *<pre>
2059     *             uta            utb
2060     *
2061     *         2450123.7           0.0       (JD method)
2062     *         2451545.0       -1421.3       (J2000 method)
2063     *         2400000.5       50123.2       (MJD method)
2064     *         2450123.5           0.2       (date &amp;time method)
2065     *</pre>
2066     *     The JD method is the most natural and convenient to use in
2067     *     cases where the loss of several decimal digits of resolution is
2068     *     acceptable.  The J2000 and MJD methods are good compromises
2069     *     between resolution and convenience.  In the case of uta,utb, the
2070     *     date &amp;time method is best matched to the Earth rotation angle
2071     *     algorithm used:  maximum precision is delivered when the uta
2072     *     argument is for 0hrs UT1 on the day in question and the utb
2073     *     argument lies in the range 0 to 1, or vice versa.
2074     *
2075     * <li> The Celestial Intermediate Pole coordinates are the x,y
2076     *     components of the unit vector in the Geocentric Celestial
2077     *     Reference System.
2078     *
2079     * <li> The arguments xp and yp are the coordinates (in radians) of the
2080     *     Celestial Intermediate Pole with respect to the International
2081     *     Terrestrial Reference System (see IERS Conventions 2003),
2082     *     measured along the meridians to 0 and 90 deg west respectively.
2083     *
2084     * <li> The matrix rc2t transforms from celestial to terrestrial
2085     *     coordinates:
2086     *
2087     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
2088     *
2089     *              = rc2t * [CRS]
2090     *
2091     *     where [CRS] is a vector in the Geocentric Celestial Reference
2092     *     System and [TRS] is a vector in the International Terrestrial
2093     *     Reference System (see IERS Conventions 2003), ERA is the Earth
2094     *     Rotation Angle and RPOM is the polar motion matrix.
2095     *
2096     * <li> Although its name does not include "00", This function is in fact
2097     *     specific to the IAU 2000 models.
2098     *</ol>
2099     *<p>Called:<ul>
2100     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
2101     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
2102     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
2103     *     <li>{@link #jauPom00} polar motion matrix
2104     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
2105     * </ul>
2106     * Reference:
2107     *
2108     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
2109     *     IERS Technical Note No. 32, BKG (2004)
2110     *
2111     *@version 2009 April 1
2112     *
2113     *  @since Release 20101201
2114     *
2115     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2116     */
2117     public static double[][] jauC2txy(double tta, double ttb, double uta, double utb,
2118                   double x, double y, double xp, double yp)
2119     {
2120        double rc2i[][] = new double[3][3], era, sp, rpom[][] = new double[3][3];
2121 
2122 
2123     /* Form the celestial-to-intermediate matrix for this TT. */
2124        rc2i = jauC2ixy(tta, ttb, x, y);
2125 
2126     /* Predict the Earth rotation angle for this UT1. */
2127        era = jauEra00(uta, utb);
2128 
2129     /* Estimate s'. */
2130        sp = jauSp00(tta, ttb);
2131 
2132     /* Form the polar motion matrix. */
2133        rpom = jauPom00(xp, yp, sp);
2134 
2135     /* Combine to form the celestial-to-terrestrial matrix. */
2136        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
2137 
2138        return rc2t;
2139 
2140         }
2141     
2142     /**
2143     *  Gregorian Calendar to Julian Date.
2144     *
2145     *<p>This function is derived from the International Astronomical Union's
2146     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2147     *
2148     *<p>Status:  support function.
2149     *
2150     *<!-- Given: -->
2151     *     @param iy  int      year in Gregorian calendar (Note 1)
2152     *     @param im  int      month in Gregorian calendar (Note 1)
2153     *     @param id   int     day in Gregorian calendar (Note 1)
2154     *
2155     *<!-- Returned: -->
2156     *     @return d MJD zero-point: always 2400000.5
2157     *       <u>returned</u> Modified Julian Date for 0 hrs
2158     *
2159     * <!-- Returned (function value): -->
2160     *  @throws JSOFAIllegalParameter      status:
2161     *                           0 = OK
2162     *                          -1 = bad year   (Note 3: JD not computed)
2163     *                          -2 = bad month  (JD not computed)
2164     *                          -3 = bad day    (JD computed)
2165     *
2166     * <p>Notes:
2167     * <ol>
2168     *
2169     * <li> The algorithm used is valid from -4800 March 1, but this
2170     *     implementation rejects dates before -4799 January 1.
2171     *
2172     * <li> The Julian Date is returned in two pieces, in the usual JSOFA
2173     *     manner, which is designed to preserve time resolution.  The
2174     *     Julian Date is available as a single number by adding djm0 and
2175     *     djm.
2176     *
2177     * <li> In early eras the conversion is from the "Proleptic Gregorian
2178     *     Calendar";  no account is taken of the date(s) of adoption of
2179     *     the Gregorian Calendar, nor is the AD/BC numbering convention
2180     *     observed.
2181     *</ol>
2182     *<p>Reference:
2183     *
2184     *     <p>Explanatory Supplement to the Astronomical Almanac,
2185     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
2186     *     Section 12.92 (p604).
2187     *
2188     *@version 2009 October 19
2189     *
2190     *  @since Release 20101201
2191     *
2192     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2193     */
2194     public static JulianDate jauCal2jd(int iy, int im, int id) throws JSOFAIllegalParameter
2195     {
2196        int ly, my;
2197        long iypmy;
2198        double djm0, djm;
2199 
2200     /* Earliest year allowed (4800BC) */
2201        final int IYMIN = -4799;
2202 
2203     /* Month lengths in days */
2204        final int mtab[]
2205                          = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
2206 
2207 
2208     /* Validate year and month. */
2209        if (iy < IYMIN) throw new JSOFAIllegalParameter("bad year", -1);
2210        if (im < 1 || im > 12) throw new JSOFAIllegalParameter("bad month", -2);
2211 
2212     /* If February in a leap year, 1, otherwise 0. */
2213        ly = ((im == 2) &&(iy%4 == 0) && (iy%100 != 0 || (iy%400 == 0)))?1:0;
2214 
2215     /* Validate day, taking into account leap years. */
2216        if ( (id < 1) || (id > (mtab[im-1] + ly))) {
2217     }
2218 
2219     /* Return result. */
2220        my = (im - 14) / 12;
2221        iypmy = (long) (iy + my);
2222        djm0 = DJM0;
2223        djm = (double)((1461L * (iypmy + 4800L)) / 4L
2224                      + (367L * (long) (im - 2 - 12 * my)) / 12L
2225                      - (3L * ((iypmy + 4900L) / 100L)) / 4L
2226                      + (long) id - 2432076L);
2227 
2228     /* Return status. */
2229        return new JulianDate(djm0, djm);
2230 
2231         }
2232     
2233 
2234     /**
2235     *  Copy a p-vector.
2236     *
2237     *<p>This function is derived from the International Astronomical Union's
2238     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2239     *
2240     *<p>Status:  vector/matrix support function.
2241     *
2242     *<!-- Given: -->
2243     *     @param p         double[3]      p-vector to be copied
2244     *
2245     *<!-- Returned: -->
2246     *     @param c         double[3]       <u>given and returned</u> copy
2247     *     @return  double[3]       <u>given and returned</u> copy
2248     *
2249     *@version 2008 May 11
2250     *
2251     *  @since Release 20101201
2252     *
2253     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2254     */
2255     public static double[] jauCp(double p[], double c[])
2256     {
2257        
2258        c[0] = p[0];
2259        c[1] = p[1];
2260        c[2] = p[2];
2261 
2262        return c;
2263 
2264     }
2265     
2266 
2267     /**
2268     *  Copy a position/velocity vector.
2269     *
2270     *<p>This function is derived from the International Astronomical Union's
2271     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2272     *
2273     *<p>Status:  vector/matrix support function.
2274     *
2275     *<!-- Given: -->
2276     *     @param pv      double[2][3]     position/velocity vector to be copied
2277     *     @param c       double[2][3]      <u>returned</u> copy
2278     *
2279     *<!-- Returned: -->
2280     *     @return        double[2][3]      <u>returned c</u> copy
2281     *
2282     *<p>Called:<ul>
2283     *     <li>{@link #jauCp} copy p-vector
2284     * </ul>
2285     *@version 2008 May 11
2286     *
2287     *  @since Release 20101201
2288     *
2289     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2290     */
2291     public static double[][] jauCpv(double pv[][],  double c[][])
2292     {
2293 
2294         c[0]=jauCp(pv[0], c[0]);
2295         c[1]=jauCp(pv[1], c[1]);
2296 
2297        return c;
2298 
2299         }
2300     
2301 
2302     /**
2303     *  Copy an r-matrix.
2304     *
2305     *<p>This function is derived from the International Astronomical Union's
2306     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2307     *
2308     *<p>Status:  vector/matrix support function.
2309     *
2310     *<!-- Given: -->
2311     *     @param r         double[3][3]     r-matrix to be copied.
2312     *
2313     *<!-- Returned: -->
2314     *   @param c      double[3][3]      <u>given and returned</u> the elements of r are copied into this.
2315     *
2316     *<p>Called:<ul>
2317     *     <li>{@link #jauCp} copy p-vector
2318     * </ul>
2319     *@version 2008 May 11
2320     *
2321     *  @since Release 20101201
2322     *
2323     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2324     */
2325     public static void jauCr(double r[][], double c[][] )
2326     {
2327 
2328        jauCp(r[0], c[0]);
2329        jauCp(r[1], c[1]);
2330        jauCp(r[2], c[2]);
2331 
2332        return;
2333 
2334         }
2335     
2336 
2337     /**
2338     *  Decompose days to hours, minutes, seconds, fraction.
2339     *
2340     *<p>This function is derived from the International Astronomical Union's
2341     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2342     *
2343     *<p>Status:  vector/matrix support function.
2344     *
2345     *<!-- Given: -->
2346     *     @param ndp      int      resolution (Note 1)
2347     *     @param days     double   interval in days
2348     *
2349     *<!-- Returned: -->
2350     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
2351     *     @return sign     char      <u>returned</u> '+' or '-'
2352     *
2353     * <p>Notes:
2354     * <ol>
2355     *
2356     * <li> The argument ndp is interpreted as follows:
2357     *
2358     *     ndp         resolution
2359     *      :      ...0000 00 00
2360     *     -7         1000 00 00
2361     *     -6          100 00 00
2362     *     -5           10 00 00
2363     *     -4            1 00 00
2364     *     -3            0 10 00
2365     *     -2            0 01 00
2366     *     -1            0 00 10
2367     *      0            0 00 01
2368     *      1            0 00 00.1
2369     *      2            0 00 00.01
2370     *      3            0 00 00.001
2371     *      :            0 00 00.000...
2372     *
2373     * <li> The largest positive useful value for ndp is determined by the
2374     *     size of days, the format of double on the target platform, and
2375     *     the risk of overflowing ihmsf[3].  On a typical platform, for
2376     *     days up to 1.0, the available floating-point precision might
2377     *     correspond to ndp=12.  However, the practical limit is typically
2378     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
2379     *     only 16 bits.
2380     *
2381     * <li> The absolute value of days may exceed 1.0.  In cases where it
2382     *     does not, it is up to the caller to test for and handle the
2383     *     case where days is very nearly 1.0 and rounds up to 24 hours,
2384     *     by testing for ihms[0]=24 and setting ihmsf[0-3] to zero.
2385     *</ol>
2386     *@version 2008 May 11
2387     *
2388     *  @since Release 20101201
2389     *
2390     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2391     */
2392    public static char jauD2tf(final int ndp, final double days, int ihmsf[])
2393     {
2394        int nrs, n;
2395        double rs, rm, rh, a, w, ah, am, as, af;
2396 
2397 
2398     /* Handle sign. */
2399       char sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
2400 
2401     /* Interval in seconds. */
2402        a = DAYSEC * abs(days);
2403 
2404     /* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
2405        if (ndp < 0) {
2406           nrs = 1;
2407           for (n = 1; n <= -ndp; n++) {
2408               nrs *= (n == 2 || n == 4) ? 6 : 10;
2409           }
2410           rs = (double) nrs;
2411           w = a / rs;
2412           a = rs * dnint(w);
2413        }
2414 
2415     /* Express the unit of each field in resolution units. */
2416        nrs = 1;
2417        for (n = 1; n <= ndp; n++) {
2418           nrs *= 10;
2419        }
2420        rs = (double) nrs;
2421        rm = rs * 60.0;
2422        rh = rm * 60.0;
2423 
2424     /* Round the interval and express in resolution units. */
2425        a = dnint(rs * a);
2426 
2427     /* Break into fields. */
2428        ah = a / rh;
2429        ah = dint(ah);
2430        a -= ah * rh;
2431        am = a / rm;
2432        am = dint(am);
2433        a -= am * rm;
2434        as = a / rs;
2435        as = dint(as);
2436        af = a - as * rs;
2437 
2438     /* Return results. */
2439        ihmsf[0] = (int) ah;
2440        ihmsf[1] = (int) am;
2441        ihmsf[2] = (int) as;
2442        ihmsf[3] = (int) af;
2443 
2444        return sign;
2445 
2446         }
2447  
2448    /**
2449     * Representation of Gregorian Calendar with fractional day.
2450     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2451     * 
2452     * @since AIDA Stage 1
2453     */
2454    public static class Calendar {
2455        public final int iy;
2456        public final int im;
2457        public final int id;
2458        public final double fd;
2459        public Calendar (int iy, int im, int id, double fd)
2460        {
2461            this.iy = iy;
2462            this.im = im;
2463            this.id = id;
2464            this.fd = fd;
2465        }
2466    }
2467 
2468    /**
2469     * Representation of Gregorian Calendar with integer hours minutes and seconds.
2470     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2471     * 
2472     * @since AIDA Stage 1
2473     */
2474    public static class CalendarHMS {
2475        public final int iy;
2476        public final int im;
2477        public final int id;
2478        public final int ihmsf[];
2479        public CalendarHMS (int iy, int im, int id, int hmsf[]){
2480            this.iy = iy;
2481            this.im = im;
2482            this.id = id;
2483            this.ihmsf = hmsf;
2484        }
2485    }
2486    
2487 /**
2488 *
2489 *  Format for output a 2-part Julian Date (or in the case of UTC a
2490 *  quasi-JD form that includes special provision for leap seconds).
2491 *
2492 *<p>This function is derived from the International Astronomical Union's
2493 *  SOFA (Standards of Fundamental Astronomy) software collection.
2494 *
2495 *<p>Status:  support function.
2496 *
2497 *<!-- Given: -->
2498 *     @param scale     char[]  time scale ID (Note 1)
2499 *     @param ndp       int     resolution (Note 2)
2500 *     @param d1     double  time as a 2-part Julian Date (Notes 3,4)
2501 *     @param d2     double  time as a 2-part Julian Date (Notes 3,4)
2502 *
2503 *<!-- Returned:-->
2504 *   @return the date as a Gregorian calendar
2505 *     iy,im,id  int     year, month, day in Gregorian calendar (Note 5)
2506 *     ihmsf     int[4]  hours, minutes, seconds, fraction (Note 1)
2507 *
2508 *  Returned (function value):
2509 *               int     status: +1 = dubious year (Note 5)
2510 *                                0 = OK
2511 *                               -1 = unacceptable date (Note 6)
2512 *
2513 *<p>Notes:
2514 *<ol>
2515 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2516 *     case) is significant, and enables handling of leap seconds (see
2517 *     Note 4).
2518 *
2519 * <li> ndp is the number of decimal places in the seconds field, and can
2520 *     have negative as well as positive values, such as:
2521 *
2522 *     ndp         resolution
2523 *     -4            1 00 00
2524 *     -3            0 10 00
2525 *     -2            0 01 00
2526 *     -1            0 00 10
2527 *      0            0 00 01
2528 *      1            0 00 00.1
2529 *      2            0 00 00.01
2530 *      3            0 00 00.001
2531 *
2532 *     The limits are platform dependent, but a safe range is -5 to +9.
2533 *
2534 * <li> d1+d2 is Julian Date, apportioned in any convenient way between
2535 *     the two arguments, for example where d1 is the Julian Day Number
2536 *     and d2 is the fraction of a day.  In the case of UTC, where the
2537 *     use of JD is problematical, special conventions apply:  see the
2538 *     next note.
2539 *
2540 * <li> JD cannot unambiguously represent UTC during a leap second unless
2541 *     special measures are taken.  The SOFA internal convention is that
2542 *     the quasi-JD day represents UTC days whether the length is 86399,
2543 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2544 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2545 *     expression was changed, and these "mini-leaps" are also included
2546 *     in the SOFA convention.
2547 *
2548 * <li> The warning status "dubious year" flags UTCs that predate the
2549 *     introduction of the time scale or that are too far in the future
2550 *     to be trusted.  See iauDat for further details.
2551 *
2552 * <li> For calendar conventions and limitations, see iauCal2jd.
2553 *</ol>
2554 *  Called:
2555 *     iauJd2cal    JD to Gregorian calendar
2556 *     iauD2tf      decompose days to hms
2557 *     iauDat       delta(AT) = TAI-UTC
2558 *
2559 *@version 2014 February 15
2560 *
2561 *@since JSOFA release 20131202
2562 *
2563 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2564  * @throws JSOFAInternalError an internal error has occured
2565  * @throws JSOFAIllegalParameter 
2566 */
2567 public static CalendarHMS jauD2dtf(final String scale, int ndp, double d1, double d2 ) throws JSOFAIllegalParameter, JSOFAInternalError
2568 {
2569  boolean leap;
2570  int iy1, im1, id1, iy2, im2, id2, ihmsf1[] = new int[4];
2571  double a1, b1, fd, dat0, dat12, dat24, dleap;
2572 
2573 
2574 /* The two-part JD. */
2575  a1 = d1;
2576  b1 = d2;
2577 
2578 /* Provisional calendar date. */
2579  Calendar cal = jauJd2cal(a1, b1);
2580  iy1 = cal.iy;
2581  im1 = cal.im;
2582  id1 = cal.id;
2583  fd = cal.fd;
2584 
2585 /* Is this a leap second day? */
2586  leap = false;
2587  if ( scale.equalsIgnoreCase("UTC") ) {
2588 
2589  /* TAI-UTC at 0h today. */
2590      dat0 = jauDat(iy1, im1, id1, 0.0 );
2591 
2592  /* TAI-UTC at 12h today (to detect drift). */
2593      dat12 = jauDat(iy1, im1, id1, 0.5);
2594 
2595  /* TAI-UTC at 0h tomorrow (to detect jumps). */
2596     cal = jauJd2cal(a1+1.5, b1-fd);
2597     iy2 = cal.iy;
2598     im2 = cal.im;
2599     id2 = cal.id;
2600     dat24 = jauDat(iy2, im2, id2, 0.0);
2601 
2602  /* Any sudden change in TAI-UTC (seconds). */
2603     dleap = dat24 - (2.0*dat12 - dat0);
2604 
2605  /* If leap second day, scale the fraction of a day into SI. */
2606     leap = (dleap != 0.0);
2607     if (leap) fd += fd * dleap/DAYSEC;
2608  }
2609 
2610 jauD2tf ( ndp, fd, ihmsf1 );
2611 
2612 /* Has the (rounded) time gone past 24h? */
2613  if ( ihmsf1[0] > 23 ) {
2614 
2615  /* Yes.  We probably need tomorrow's calendar date. */
2616     cal = jauJd2cal(a1+1.5, b1-fd);
2617     iy2 = cal.iy; im2 = cal.im; id2 = cal.id; 
2618     
2619  /* Is today a leap second day? */
2620     if ( ! leap ) {
2621 
2622     /* No.  Use 0h tomorrow. */
2623        iy1 = iy2;
2624        im1 = im2;
2625        id1 = id2;
2626        ihmsf1[0] = 0;
2627        ihmsf1[1] = 0;
2628        ihmsf1[2] = 0;
2629 
2630     } else {
2631 
2632     /* Yes.  Are we past the leap second itself? */
2633        if ( ihmsf1[2] > 0 ) {
2634 
2635        /* Yes.  Use tomorrow but allow for the leap second. */
2636           iy1 = iy2;
2637           im1 = im2;
2638           id1 = id2;
2639           ihmsf1[0] = 0;
2640           ihmsf1[1] = 0;
2641           ihmsf1[2] = 0;
2642 
2643        } else {
2644 
2645        /* No.  Use 23 59 60... today. */
2646           ihmsf1[0] = 23;
2647           ihmsf1[1] = 59;
2648           ihmsf1[2] = 60;
2649        }
2650 
2651     /* If rounding to 10s or coarser always go up to new day. */
2652        if ( ndp < 0 && ihmsf1[2] == 60 ) {
2653           iy1 = iy2;
2654           im1 = im2;
2655           id1 = id2;
2656           ihmsf1[0] = 0;
2657           ihmsf1[1] = 0;
2658           ihmsf1[2] = 0;
2659        }
2660     }
2661  }
2662 
2663 /* Results. */
2664  
2665  return new CalendarHMS(iy1, im1, id1, ihmsf1);
2666 
2667 }   
2668 
2669 /**
2670 *  Encode date and time fields into 2-part Julian Date (or in the case
2671 *  of UTC a quasi-JD form that includes special provision for leap
2672 *  seconds).
2673 *
2674 *<p>This function is derived from the International Astronomical Union's
2675 *  SOFA (Standards of Fundamental Astronomy) software collection.
2676 *
2677 *  <p>Status:  support function.
2678 *
2679 * <!-- Given: -->
2680 *    @param scale     char  time scale ID (Note 1)
2681 *    @param iy  int     year in Gregorian calendar (Note 2)
2682 *    @param im   int    month in Gregorian calendar (Note 2)
2683 *    @param id  int      day in Gregorian calendar (Note 2)
2684 *    @param ihr  int     hour
2685 *    @param imn   int    minute
2686 *    @param sec       double  seconds
2687 *
2688 * <!-- Returned: -->
2689 *     @return     2-part Julian Date (Notes 3,4)
2690 *
2691 * @throws JSOFAIllegalParameter 
2692 * 
2693 * @throws JSOFAInternalError          {@code    status: +3 = both of next two
2694 *                               +2 = time is after end of day (Note 5)
2695 *                               +1 = dubious year (Note 6)
2696 *                                0 = OK
2697 *                               -1 = bad year
2698 *                               -2 = bad month
2699 *                               -3 = bad day
2700 *                               -4 = bad hour
2701 *                               -5 = bad minute
2702 *                               -6 = bad second (<0)}
2703 *
2704 *<p>Notes:
2705 *<ol>
2706 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2707 *     case) is significant, and enables handling of leap seconds (see
2708 *     Note 4).
2709 *
2710 * <li> For calendar conventions and limitations, see iauCal2jd.
2711 *
2712 * <li> The sum of the results, d1+d2, is Julian Date, where normally d1
2713 *     is the Julian Day Number and d2 is the fraction of a day.  In the
2714 *     case of UTC, where the use of JD is problematical, special
2715 *     conventions apply:  see the next note.
2716 *
2717 * <li> JD cannot unambiguously represent UTC during a leap second unless
2718 *     special measures are taken.  The SOFA internal convention is that
2719 *     the quasi-JD day represents UTC days whether the length is 86399,
2720 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2721 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2722 *     expression was changed, and these "mini-leaps" are also included
2723 *     in the SOFA convention.
2724 *
2725 * <li> The warning status "time is after end of day" usually means that
2726 *     the sec argument is greater than 60.0.  However, in a day ending
2727 *     in a leap second the limit changes to 61.0 (or 59.0 in the case
2728 *     of a negative leap second).
2729 *
2730 * <li> The warning status "dubious year" flags UTCs that predate the
2731 *     introduction of the time scale or that are too far in the future
2732 *     to be trusted.  See iauDat for further details.
2733 *
2734 * <li> Only in the case of continuous and regular time scales (TAI, TT,
2735 *     TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly
2736 *     speaking.  In the other cases (UT1 and UTC) the result must be
2737 *     used with circumspection;  in particular the difference between
2738 *     two such results cannot be interpreted as a precise time
2739 *     interval.
2740 *</ol>
2741 *  Called:
2742 *     iauCal2jd    Gregorian calendar to JD
2743 *     iauDat       delta(AT) = TAI-UTC
2744 *     iauJd2cal    JD to Gregorian calendar
2745 *
2746 *@version 2013 July 26
2747 *
2748 *@since JSOFA release 20131202
2749 *
2750 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2751 */
2752 public static JulianDate jauDtf2d(final String scale, int iy, int im, int id,
2753         int ihr, int imn, double sec) throws JSOFAIllegalParameter, JSOFAInternalError
2754 {
2755 int js = 0, iy2, im2, id2;
2756 double dj, w, day, seclim, dat0, dat12, dat24, dleap, time;
2757 
2758 
2759 /* Today's Julian Day Number. */
2760 JulianDate jd = jauCal2jd(iy, im, id);
2761 dj = jd.djm0; w = jd.djm1;
2762 dj += w;
2763 
2764 /* Day length and final minute length in seconds (provisional). */
2765 day = DAYSEC;
2766 seclim = 60.0;
2767 
2768 /* Deal with the UTC leap second case. */
2769 if (  scale.equals("UTC") ) {
2770 
2771 /* TAI-UTC at 0h today. */
2772     dat0 = jauDat(iy, im, id, 0.0);
2773 
2774 /* TAI-UTC at 12h today (to detect drift). */
2775     dat12 = jauDat(iy, im, id, 0.5);
2776 
2777 /* TAI-UTC at 0h tomorrow (to detect jumps). */
2778  Calendar cal = jauJd2cal ( dj, 1.5);
2779  iy2 = cal.iy; im2 = cal.im; id2 = cal.id; w = cal.fd;
2780  
2781  dat24 = jauDat(iy2, im2, id2, 0.0);
2782 
2783 /* Any sudden change in TAI-UTC between today and tomorrow. */
2784  dleap = dat24 - (2.0*dat12 - dat0);
2785 
2786 /* If leap second day, correct the day and final minute lengths. */
2787  day += dleap;
2788  if ( ihr == 23 && imn == 59 ) seclim += dleap;
2789 
2790 /* End of UTC-specific actions. */
2791 }
2792 
2793 /* Validate the time. */
2794 if ( ihr >= 0 && ihr <= 23 ) {
2795  if ( imn >= 0 && imn <= 59 ) {
2796     if ( sec >= 0 ) {
2797        if ( sec >= seclim ) {
2798           js += 2;
2799        }
2800     } else {
2801        js = -6;
2802     }
2803  } else {
2804     js = -5;
2805  }
2806 } else {
2807  js = -4;
2808 }
2809 if ( js < 0 ) throw new JSOFAInternalError("problem with time", js);
2810 
2811 /* The time in days. */
2812 time  = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day;
2813 
2814 /* Return the date and time. */
2815 return new JulianDate(dj, time) ;
2816 
2817 }
2818 
2819 /**
2820  * the date of the last leap second. Note that this is not a SOFA standard fumction.
2821  * @return the {@link JulianDate} of the last leap second.
2822  */
2823 public static JulianDate lastLeapSecondDate()
2824 {
2825     final LeapInfo lastentry = leapSeconds[leapSeconds.length -1];
2826     JulianDate retval = new JulianDate(0, 0);
2827     try {
2828         retval = jauCal2jd(lastentry.iyear,lastentry.month,1);
2829     } catch (JSOFAIllegalParameter e) {
2830         //should not happen
2831          e.printStackTrace();
2832     }
2833     return retval;
2834     
2835 }
2836  
2837 
2838     /**
2839     *  For a given UTC date, calculate delta(AT) = TAI-UTC.
2840     *<pre>
2841     *     :------------------------------------------:
2842     *     :                                          :
2843     *     :                 IMPORTANT                :
2844     *     :                                          :
2845     *     :  A new version of this function must be  :
2846     *     :  produced whenever a new leap second is  :
2847     *     :  announced.  There are four items to     :
2848     *     :  change on each such occasion:           :
2849     *     :                                          :
2850     *     :  1) A new line must be added to the set  :
2851     *     :     of statements that initialize the    :
2852     *     :     array "changes".                     :
2853     *     :                                          :
2854     *     :  2) The parameter IYV must be set to     :
2855     *     :     the current year.                    :
2856     *     :                                          :
2857     *     :  3) The "Latest leap second" comment     :
2858     *     :     below must be set to the new leap    :
2859     *     :     second date.                         :
2860     *     :                                          :
2861     *     :  4) The "This revision" comment, later,  :
2862     *     :     must be set to the current date.     :
2863     *     :                                          :
2864     *     :  Change (2) must also be carried out     :
2865     *     :  whenever the function is re-issued,     :
2866     *     :  even if no leap seconds have been       :
2867     *     :  added.                                  :
2868     *     :                                          :
2869     *     :  Latest leap second:  2017 Jan 01        :
2870     *     :                                          :
2871     *     :__________________________________________:
2872     *</pre>
2873     *<p>This function is derived from the International Astronomical Union's
2874     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2875     *
2876     *<p>Status:  support function.
2877     *
2878     *<!-- Given: -->
2879     *     @param iy      int       UTC:  year (Notes 1 and 2)
2880     *     @param im      int             month (Note 2)
2881     *     @param id      int             day (Notes 2 and 3)
2882     *     @param fd      double          fraction of day (Note 4)
2883     *
2884     *<!-- Returned: -->
2885     *     @return deltat  double     <u>returned</u> TAI minus UTC, seconds
2886     *
2887     *  @throws     JSOFAIllegalParameter   status (Note 5):
2888     *                       1 = dubious year (Note 1)
2889     *                       0 = OK
2890     *                      -1 = bad year
2891     *                      -2 = bad month
2892     *                      -3 = bad day (Note 3)
2893     *                      -4 = bad fraction (Note 4)
2894     *
2895     * <p>Notes:
2896     * <ol>
2897     *
2898     * <li> UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
2899     *     to call the function with an earlier date.  If this is attempted,
2900     *     zero is returned together with a warning status.
2901     *
2902     *     Because leap seconds cannot, in principle, be predicted in
2903     *     advance, a reliable check for dates beyond the valid range is
2904     *     impossible.  To guard against gross errors, a year five or more
2905     *     after the release year of the present function (see parameter
2906     *     IYV) is considered dubious.  In this case a warning status is
2907     *     returned but the result is computed in the normal way.
2908     *
2909     *     For both too-early and too-late years, the warning status is
2910     *     j=+1.  This is distinct from the error status j=-1, which
2911     *     signifies a year so early that JD could not be computed.
2912     *
2913     * <li> If the specified date is for a day which ends with a leap second,
2914     *     the TAI-UTC value returned is for the period leading up to the
2915     *     leap second.  If the date is for a day which begins as a leap
2916     *     second ends, the TAI-UTC returned is for the period following the
2917     *     leap second.
2918     *
2919     * <li> The day number must be in the normal calendar range, for example
2920     *     1 through 30 for April.  The "almanac" convention of allowing
2921     *     such dates as January 0 and December 32 is not supported in this
2922     *     function, in order to avoid confusion near leap seconds.
2923     *
2924     * <li> The fraction of day is used only for dates before the
2925     *     introduction of leap seconds, the first of which occurred at the
2926     *     end of 1971.  It is tested for validity (zero to less than 1 is
2927     *     the valid range) even if not used;  if invalid, zero is used and
2928     *     status j=-4 is returned.  For many applications, setting fd to
2929     *     zero is acceptable;  the resulting error is always less than 3 ms
2930     *     (and occurs only pre-1972).
2931     *
2932     * <li> The status value returned in the case where there are multiple
2933     *     errors refers to the first error detected.  For example, if the
2934     *     month and day are 13 and 32 respectively, j=-2 (bad month)
2935     *     will be returned.
2936     *
2937     * <li> In cases where a valid result is not available, zero is returned.
2938     *
2939     *<p>References:
2940     *
2941     * <li> For dates from 1961 January 1 onwards, the expressions from the
2942     *     file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
2943     *
2944     * <li> The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of
2945     *     the 1992 Explanatory Supplement.
2946     *</ol>
2947     *<p>Called:<ul>
2948     *     <li>{@link #jauCal2jd} Gregorian calendar to Julian Day number
2949     * </ul>
2950     *<p>@version 20160729
2951     *
2952     *  @since Release 20101201
2953     *
2954     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2955     */
2956     public static double jauDat(int iy, int im, int id, double fd ) throws JSOFAIllegalParameter, JSOFAInternalError
2957     {
2958 
2959     /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
2960       final double drift[][] = {
2961           { 37300.0, 0.0012960 },
2962           { 37300.0, 0.0012960 },
2963           { 37300.0, 0.0012960 },
2964           { 37665.0, 0.0011232 },
2965           { 37665.0, 0.0011232 },
2966           { 38761.0, 0.0012960 },
2967           { 38761.0, 0.0012960 },
2968           { 38761.0, 0.0012960 },
2969           { 38761.0, 0.0012960 },
2970           { 38761.0, 0.0012960 },
2971           { 38761.0, 0.0012960 },
2972           { 38761.0, 0.0012960 },
2973           { 39126.0, 0.0025920 },
2974           { 39126.0, 0.0025920 }
2975        };
2976 
2977     /* Number of Delta(AT) expressions before leap seconds were introduced */
2978     final int NERA1 = drift.length;
2979 
2980 
2981     /* Number of Delta(AT) changes */
2982        final int NDAT = leapSeconds.length;
2983 
2984     /* Miscellaneous local variables */
2985        int i, m;
2986        double da, djm;
2987 
2988 
2989     /* Initialize the result to zero. */
2990        double deltat = da = 0.0;
2991 
2992     /* If invalid fraction of a day, set error status and give up. */
2993        if (fd < 0.0 || fd > 1.0) throw new JSOFAIllegalParameter("bad day fraction", -4);
2994 
2995     /* Convert the date into an MJD. */
2996        JulianDate jd = jauCal2jd(iy, im, id);
2997        djm = jd.djm1;
2998 
2999     /* If pre-UTC year, set warning status and give up. */
3000        if (iy < leapSeconds[0].iyear) throw new JSOFAInternalError("year before UTC start", 1);
3001 
3002     /* If suspiciously late year, set warning status but proceed. */
3003        if (iy > IYV + 5) {
3004     }
3005 
3006     /* Combine year and month to form a date-ordered integer... */
3007        m = 12*iy + im;
3008 
3009     /* ...and use it to find the preceding table entry. */
3010        for (i = NDAT-1; i >=0; i--) {
3011           if (m >= (12 * leapSeconds[i].iyear + leapSeconds[i].month)) break;
3012        }
3013 
3014     /* Get the Delta(AT). */
3015        da = leapSeconds[i].delat;
3016 
3017     /* If pre-1972, adjust for drift. */
3018        if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];
3019 
3020     /* Return the Delta(AT) value. */
3021        deltat = da;
3022 
3023     /* Return the value. */
3024        return deltat;
3025 
3026         }
3027     
3028 
3029     /**
3030     *  An approximation to TDB-TT, the difference between barycentric
3031     *  dynamical time and terrestrial time, for an observer on the Earth.
3032     *
3033     *  The different time scales - proper, coordinate and realized - are
3034     *  related to each other:
3035     *  {@code
3036     *            TAI             <-  physically realized
3037     *             :
3038     *          offset            <-  observed (nominally +32.184s)
3039     *             :
3040     *            TT              <-  terrestrial time
3041     *             :
3042     *    rate adjustment (L_G)   <-  definition of TT
3043     *             :
3044     *            TCG             <-  time scale for GCRS
3045     *             :
3046     *      "periodic" terms      <-  jauDtdb  is an implementation
3047     *             :
3048     *    rate adjustment (L_C)   <-  function of solar-system ephemeris
3049     *             :
3050     *            TCB             <-  time scale for BCRS
3051     *             :
3052     *    rate adjustment (-L_B)  <-  definition of TDB
3053     *             :
3054     *            TDB             <-  TCB scaled to track TT
3055     *             :
3056     *      "periodic" terms      <-  -jau_DTDB is an approximation
3057     *             :
3058     *            TT              <-  terrestrial time
3059     *}
3060     *  Adopted values for the various constants can be found in the IERS
3061     *  Conventions (McCarthy &amp; Petit 2003).
3062     *
3063     *<p>This function is derived from the International Astronomical Union's
3064     *  SOFA (Standards Of Fundamental Astronomy) software collection.
3065     *
3066     *<p>Status:  canonical model.
3067     *
3068     *<!-- Given: -->
3069     *     @param date1 double   date, TDB (Notes 1-3)
3070     *     @param date2 double   date, TDB (Notes 1-3) 
3071     *     @param ut             double   universal time (UT1, fraction of one day)
3072     *     @param elong          double   longitude (east positive, radians)
3073     *     @param u              double   distance from Earth spin axis (km)
3074     *     @param v              double   distance north of equatorial plane (km)
3075     *
3076     * <!-- Returned (function value): -->
3077     *  @return            double  TDB-TT (seconds)
3078     *
3079     * <p>Notes:
3080     * <ol>
3081     *
3082     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
3083     *     convenient way between the two arguments.  For example,
3084     *     JD(TT)=2450123.7 could be expressed in any of these ways,
3085     *     among others:
3086     *<pre>
3087     *            date1          date2
3088     *
3089     *         2450123.7           0.0       (JD method)
3090     *         2451545.0       -1421.3       (J2000 method)
3091     *         2400000.5       50123.2       (MJD method)
3092     *         2450123.5           0.2       (date &amp; time method)
3093     *</pre>
3094     *     The JD method is the most natural and convenient to use in
3095     *     cases where the loss of several decimal digits of resolution
3096     *     is acceptable.  The J2000 method is best matched to the way
3097     *     the argument is handled internally and will deliver the
3098     *     optimum resolution.  The MJD method and the date &amp; time methods
3099     *     are both good compromises between resolution and convenience.
3100     *
3101     *     Although the date is, formally, barycentric dynamical time (TDB),
3102     *     the terrestrial dynamical time (TT) can be used with no practical
3103     *     effect on the accuracy of the prediction.
3104     *
3105     * <li> TT can be regarded as a coordinate time that is realized as an
3106     *     offset of 32.184s from International Atomic Time, TAI.  TT is a
3107     *     specific linear transformation of geocentric coordinate time TCG,
3108     *     which is the time scale for the Geocentric Celestial Reference
3109     *     System, GCRS.
3110     *
3111     * <li> TDB is a coordinate time, and is a specific linear transformation
3112     *     of barycentric coordinate time TCB, which is the time scale for
3113     *     the Barycentric Celestial Reference System, BCRS.
3114     *
3115     * <li> The difference TCG-TCB depends on the masses and positions of the
3116     *     bodies of the solar system and the velocity of the Earth.  It is
3117     *     dominated by a rate difference, the residual being of a periodic
3118     *     character.  The latter, which is modeled by the present function,
3119     *     comprises a main (annual) sinusoidal term of amplitude
3120     *     approximately 0.00166 seconds, plus planetary terms up to about
3121     *     20 microseconds, and lunar and diurnal terms up to 2 microseconds.
3122     *     These effects come from the changing transverse Doppler effect
3123     *     and gravitational red-shift as the observer (on the Earth's
3124     *     surface) experiences variations in speed (with respect to the
3125     *     BCRS) and gravitational potential.
3126     *
3127     * <li> TDB can be regarded as the same as TCB but with a rate adjustment
3128     *     to keep it close to TT, which is convenient for many applications.
3129     *     The history of successive attempts to define TDB is set out in
3130     *     Resolution 3 adopted by the IAU General Assembly in 2006, which
3131     *     defines a fixed TDB(TCB) transformation that is consistent with
3132     *     contemporary solar-system ephemerides.  Future ephemerides will
3133     *     imply slightly changed transformations between TCG and TCB, which
3134     *     could introduce a linear drift between TDB and TT;  however, any
3135     *     such drift is unlikely to exceed 1 nanosecond per century.
3136     *
3137     * <li> The geocentric TDB-TT model used in the present function is that of
3138     *     Fairhead &amp; Bretagnon (1990), in its full form.  It was originally
3139     *     supplied by Fairhead (private communications with P.T.Wallace,
3140     *     1990) as a Fortran subroutine.  The present C function contains an
3141     *     adaptation of the Fairhead code.  The numerical results are
3142     *     essentially unaffected by the changes, the differences with
3143     *     respect to the Fairhead &amp; Bretagnon original being at the 1e-20 s
3144     *     level.
3145     *
3146     *     The topocentric part of the model is from Moyer (1981) and
3147     *     Murray (1983), with fundamental arguments adapted from
3148     *     Simon et al. 1994.  It is an approximation to the expression
3149     *     ( v / c ) . ( r / c ), where v is the barycentric velocity of
3150     *     the Earth, r is the geocentric position of the observer and
3151     *     c is the speed of light.
3152     *
3153     *     By supplying zeroes for u and v, the topocentric part of the
3154     *     model can be nullified, and the function will return the Fairhead
3155     *     &amp; Bretagnon result alone.
3156     *
3157     * <li> During the interval 1950-2050, the absolute accuracy is better
3158     *     than +/- 3 nanoseconds relative to time ephemerides obtained by
3159     *     direct numerical integrations based on the JPL DE405 solar system
3160     *     ephemeris.
3161     *
3162     * <li> It must be stressed that the present function is merely a model,
3163     *     and that numerical integration of solar-system ephemerides is the
3164     *     definitive method for predicting the relationship between TCG and
3165     *     TCB and hence between TT and TDB.
3166     *</ol>
3167     *<p>References:
3168     *
3169     *     <p>Fairhead, L., &amp; Bretagnon, P., Astron.Astrophys., 229, 240-247
3170     *     (1990).
3171     *
3172     *     <p>IAU 2006 Resolution 3.
3173     *
3174     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
3175     *     IERS Technical Note No. 32, BKG (2004)
3176     *
3177     *     <p>Moyer, T.D., Cel.Mech., 23, 33 (1981).
3178     *
3179     *     <p>Murray, C.A., Vectorial Astrometry, Adam Hilger (1983).
3180     *
3181     *     <p>Seidelmann, P.K. et al., Explanatory Supplement to the
3182     *     Astronomical Almanac, Chapter 2, University Science Books (1992).
3183     *
3184     *     <p>Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
3185     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 282, 663-683 (1994).
3186     *
3187     *@version 2009 December 17
3188     *
3189     *  @since Release 20101201
3190     *
3191     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
3192     */
3193     public static  double jauDtdb(double date1, double date2,
3194                    double ut, double elong, double u, double v)
3195     {
3196        double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4,
3197               wf, wj;
3198        int j;
3199 
3200     /*
3201     * =====================
3202     * Fairhead et al. model
3203     * =====================
3204     *
3205     * 787 sets of three coefficients.
3206     *
3207     * Each set is
3208     *    amplitude (microseconds)
3209     *      frequency (radians per Julian millennium since J2000.0)
3210     *      phase (radians)
3211     *
3212     * Sets   1-474 are the T**0 terms
3213     *  "   475-679  "   "  T**1
3214     *  "   680-764  "   "  T**2
3215     *  "   765-784  "   "  T**3
3216     *  "   785-787  "   "  T**4
3217     */
3218 
3219        final double fairhd[][] = {
3220        /* 1, 10 */
3221           { 1656.674564e-6,     6283.075849991,  6.240054195 },
3222           {   22.417471e-6,     5753.384884897,  4.296977442 },
3223           {   13.839792e-6,    12566.151699983,  6.196904410 },
3224           {    4.770086e-6,      529.690965095,  0.444401603 },
3225           {    4.676740e-6,     6069.776754553,  4.021195093 },
3226           {    2.256707e-6,      213.299095438,  5.543113262 },
3227           {    1.694205e-6,      -3.523118349,   5.025132748 },
3228           {    1.554905e-6,    77713.771467920,  5.198467090 },
3229           {    1.276839e-6,     7860.419392439,  5.988822341 },
3230           {    1.193379e-6,     5223.693919802,  3.649823730 },
3231        /* 11, 20 */
3232           {    1.115322e-6,     3930.209696220,  1.422745069 },
3233           {    0.794185e-6,    11506.769769794,  2.322313077 },
3234           {    0.447061e-6,       26.298319800,  3.615796498 },
3235           {    0.435206e-6,     -398.149003408,  4.349338347 },
3236           {    0.600309e-6,     1577.343542448,  2.678271909 },
3237           {    0.496817e-6,     6208.294251424,  5.696701824 },
3238           {    0.486306e-6,     5884.926846583,  0.520007179 },
3239           {    0.432392e-6,       74.781598567,  2.435898309 },
3240           {    0.468597e-6,     6244.942814354,  5.866398759 },
3241           {    0.375510e-6,     5507.553238667,  4.103476804 },
3242        /* 21, 30 */
3243           {    0.243085e-6,     -775.522611324,  3.651837925 },
3244           {    0.173435e-6,    18849.227549974,  6.153743485 },
3245           {    0.230685e-6,     5856.477659115,  4.773852582 },
3246           {    0.203747e-6,    12036.460734888,  4.333987818 },
3247           {    0.143935e-6,     -796.298006816,  5.957517795 },
3248           {    0.159080e-6,    10977.078804699,  1.890075226 },
3249           {    0.119979e-6,       38.133035638,  4.551585768 },
3250           {    0.118971e-6,     5486.777843175,  1.914547226 },
3251           {    0.116120e-6,     1059.381930189,  0.873504123 },
3252           {    0.137927e-6,    11790.629088659,  1.135934669 },
3253        /* 31, 40 */
3254           {    0.098358e-6,     2544.314419883,  0.092793886 },
3255           {    0.101868e-6,    -5573.142801634,  5.984503847 },
3256           {    0.080164e-6,      206.185548437,  2.095377709 },
3257           {    0.079645e-6,     4694.002954708,  2.949233637 },
3258           {    0.062617e-6,       20.775395492,  2.654394814 },
3259           {    0.075019e-6,     2942.463423292,  4.980931759 },
3260           {    0.064397e-6,     5746.271337896,  1.280308748 },
3261           {    0.063814e-6,     5760.498431898,  4.167901731 },
3262           {    0.048042e-6,     2146.165416475,  1.495846011 },
3263           {    0.048373e-6,      155.420399434,  2.251573730 },
3264        /* 41, 50 */
3265           {    0.058844e-6,      426.598190876,  4.839650148 },
3266           {    0.046551e-6,       -0.980321068,  0.921573539 },
3267           {    0.054139e-6,    17260.154654690,  3.411091093 },
3268           {    0.042411e-6,     6275.962302991,  2.869567043 },
3269           {    0.040184e-6,       -7.113547001,  3.565975565 },
3270           {    0.036564e-6,     5088.628839767,  3.324679049 },
3271           {    0.040759e-6,    12352.852604545,  3.981496998 },
3272           {    0.036507e-6,      801.820931124,  6.248866009 },
3273           {    0.036955e-6,     3154.687084896,  5.071801441 },
3274           {    0.042732e-6,      632.783739313,  5.720622217 },
3275        /* 51, 60 */
3276           {    0.042560e-6,   161000.685737473,  1.270837679 },
3277           {    0.040480e-6,    15720.838784878,  2.546610123 },
3278           {    0.028244e-6,    -6286.598968340,  5.069663519 },
3279           {    0.033477e-6,     6062.663207553,  4.144987272 },
3280           {    0.034867e-6,      522.577418094,  5.210064075 },
3281           {    0.032438e-6,     6076.890301554,  0.749317412 },
3282           {    0.030215e-6,     7084.896781115,  3.389610345 },
3283           {    0.029247e-6,   -71430.695617928,  4.183178762 },
3284           {    0.033529e-6,     9437.762934887,  2.404714239 },
3285           {    0.032423e-6,     8827.390269875,  5.541473556 },
3286        /* 61, 70 */
3287           {    0.027567e-6,     6279.552731642,  5.040846034 },
3288           {    0.029862e-6,    12139.553509107,  1.770181024 },
3289           {    0.022509e-6,    10447.387839604,  1.460726241 },
3290           {    0.020937e-6,     8429.241266467,  0.652303414 },
3291           {    0.020322e-6,      419.484643875,  3.735430632 },
3292           {    0.024816e-6,    -1194.447010225,  1.087136918 },
3293           {    0.025196e-6,     1748.016413067,  2.901883301 },
3294           {    0.021691e-6,    14143.495242431,  5.952658009 },
3295           {    0.017673e-6,     6812.766815086,  3.186129845 },
3296           {    0.022567e-6,     6133.512652857,  3.307984806 },
3297        /* 71, 80 */
3298           {    0.016155e-6,    10213.285546211,  1.331103168 },
3299           {    0.014751e-6,     1349.867409659,  4.308933301 },
3300           {    0.015949e-6,     -220.412642439,  4.005298270 },
3301           {    0.015974e-6,    -2352.866153772,  6.145309371 },
3302           {    0.014223e-6,    17789.845619785,  2.104551349 },
3303           {    0.017806e-6,       73.297125859,  3.475975097 },
3304           {    0.013671e-6,     -536.804512095,  5.971672571 },
3305           {    0.011942e-6,     8031.092263058,  2.053414715 },
3306           {    0.014318e-6,    16730.463689596,  3.016058075 },
3307           {    0.012462e-6,      103.092774219,  1.737438797 },
3308        /* 81, 90 */
3309           {    0.010962e-6,        3.590428652,  2.196567739 },
3310           {    0.015078e-6,    19651.048481098,  3.969480770 },
3311           {    0.010396e-6,      951.718406251,  5.717799605 },
3312           {    0.011707e-6,    -4705.732307544,  2.654125618 },
3313           {    0.010453e-6,     5863.591206116,  1.913704550 },
3314           {    0.012420e-6,     4690.479836359,  4.734090399 },
3315           {    0.011847e-6,     5643.178563677,  5.489005403 },
3316           {    0.008610e-6,     3340.612426700,  3.661698944 },
3317           {    0.011622e-6,     5120.601145584,  4.863931876 },
3318           {    0.010825e-6,      553.569402842,  0.842715011 },
3319        /* 91, 100 */
3320           {    0.008666e-6,     -135.065080035,  3.293406547 },
3321           {    0.009963e-6,      149.563197135,  4.870690598 },
3322           {    0.009858e-6,     6309.374169791,  1.061816410 },
3323           {    0.007959e-6,      316.391869657,  2.465042647 },
3324           {    0.010099e-6,      283.859318865,  1.942176992 },
3325           {    0.007147e-6,     -242.728603974,  3.661486981 },
3326           {    0.007505e-6,     5230.807466803,  4.920937029 },
3327           {    0.008323e-6,    11769.853693166,  1.229392026 },
3328           {    0.007490e-6,    -6256.777530192,  3.658444681 },
3329           {    0.009370e-6,   149854.400134205,  0.673880395 },
3330        /* 101, 110 */
3331           {    0.007117e-6,       38.027672636,  5.294249518 },
3332           {    0.007857e-6,    12168.002696575,  0.525733528 },
3333           {    0.007019e-6,     6206.809778716,  0.837688810 },
3334           {    0.006056e-6,      955.599741609,  4.194535082 },
3335           {    0.008107e-6,    13367.972631107,  3.793235253 },
3336           {    0.006731e-6,     5650.292110678,  5.639906583 },
3337           {    0.007332e-6,       36.648562930,  0.114858677 },
3338           {    0.006366e-6,     4164.311989613,  2.262081818 },
3339           {    0.006858e-6,     5216.580372801,  0.642063318 },
3340           {    0.006919e-6,     6681.224853400,  6.018501522 },
3341        /* 111, 120 */
3342           {    0.006826e-6,     7632.943259650,  3.458654112 },
3343           {    0.005308e-6,    -1592.596013633,  2.500382359 },
3344           {    0.005096e-6,    11371.704689758,  2.547107806 },
3345           {    0.004841e-6,     5333.900241022,  0.437078094 },
3346           {    0.005582e-6,     5966.683980335,  2.246174308 },
3347           {    0.006304e-6,    11926.254413669,  2.512929171 },
3348           {    0.006603e-6,    23581.258177318,  5.393136889 },
3349           {    0.005123e-6,       -1.484472708,  2.999641028 },
3350           {    0.004648e-6,     1589.072895284,  1.275847090 },
3351           {    0.005119e-6,     6438.496249426,  1.486539246 },
3352        /* 121, 130 */
3353           {    0.004521e-6,     4292.330832950,  6.140635794 },
3354           {    0.005680e-6,    23013.539539587,  4.557814849 },
3355           {    0.005488e-6,       -3.455808046,  0.090675389 },
3356           {    0.004193e-6,     7234.794256242,  4.869091389 },
3357           {    0.003742e-6,     7238.675591600,  4.691976180 },
3358           {    0.004148e-6,     -110.206321219,  3.016173439 },
3359           {    0.004553e-6,    11499.656222793,  5.554998314 },
3360           {    0.004892e-6,     5436.993015240,  1.475415597 },
3361           {    0.004044e-6,     4732.030627343,  1.398784824 },
3362           {    0.004164e-6,    12491.370101415,  5.650931916 },
3363        /* 131, 140 */
3364           {    0.004349e-6,    11513.883316794,  2.181745369 },
3365           {    0.003919e-6,    12528.018664345,  5.823319737 },
3366           {    0.003129e-6,     6836.645252834,  0.003844094 },
3367           {    0.004080e-6,    -7058.598461315,  3.690360123 },
3368           {    0.003270e-6,       76.266071276,  1.517189902 },
3369           {    0.002954e-6,     6283.143160294,  4.447203799 },
3370           {    0.002872e-6,       28.449187468,  1.158692983 },
3371           {    0.002881e-6,      735.876513532,  0.349250250 },
3372           {    0.003279e-6,     5849.364112115,  4.893384368 },
3373           {    0.003625e-6,     6209.778724132,  1.473760578 },
3374        /* 141, 150 */
3375           {    0.003074e-6,      949.175608970,  5.185878737 },
3376           {    0.002775e-6,     9917.696874510,  1.030026325 },
3377           {    0.002646e-6,    10973.555686350,  3.918259169 },
3378           {    0.002575e-6,    25132.303399966,  6.109659023 },
3379           {    0.003500e-6,      263.083923373,  1.892100742 },
3380           {    0.002740e-6,    18319.536584880,  4.320519510 },
3381           {    0.002464e-6,      202.253395174,  4.698203059 },
3382           {    0.002409e-6,        2.542797281,  5.325009315 },
3383           {    0.003354e-6,   -90955.551694697,  1.942656623 },
3384           {    0.002296e-6,     6496.374945429,  5.061810696 },
3385        /* 151, 160 */
3386           {    0.003002e-6,     6172.869528772,  2.797822767 },
3387           {    0.003202e-6,    27511.467873537,  0.531673101 },
3388           {    0.002954e-6,    -6283.008539689,  4.533471191 },
3389           {    0.002353e-6,      639.897286314,  3.734548088 },
3390           {    0.002401e-6,    16200.772724501,  2.605547070 },
3391           {    0.003053e-6,   233141.314403759,  3.029030662 },
3392           {    0.003024e-6,    83286.914269554,  2.355556099 },
3393           {    0.002863e-6,    17298.182327326,  5.240963796 },
3394           {    0.002103e-6,    -7079.373856808,  5.756641637 },
3395           {    0.002303e-6,    83996.847317911,  2.013686814 },
3396        /* 161, 170 */
3397           {    0.002303e-6,    18073.704938650,  1.089100410 },
3398           {    0.002381e-6,       63.735898303,  0.759188178 },
3399           {    0.002493e-6,     6386.168624210,  0.645026535 },
3400           {    0.002366e-6,        3.932153263,  6.215885448 },
3401           {    0.002169e-6,    11015.106477335,  4.845297676 },
3402           {    0.002397e-6,     6243.458341645,  3.809290043 },
3403           {    0.002183e-6,     1162.474704408,  6.179611691 },
3404           {    0.002353e-6,     6246.427287062,  4.781719760 },
3405           {    0.002199e-6,     -245.831646229,  5.956152284 },
3406           {    0.001729e-6,     3894.181829542,  1.264976635 },
3407        /* 171, 180 */
3408           {    0.001896e-6,    -3128.388765096,  4.914231596 },
3409           {    0.002085e-6,       35.164090221,  1.405158503 },
3410           {    0.002024e-6,    14712.317116458,  2.752035928 },
3411           {    0.001737e-6,     6290.189396992,  5.280820144 },
3412           {    0.002229e-6,      491.557929457,  1.571007057 },
3413           {    0.001602e-6,    14314.168113050,  4.203664806 },
3414           {    0.002186e-6,      454.909366527,  1.402101526 },
3415           {    0.001897e-6,    22483.848574493,  4.167932508 },
3416           {    0.001825e-6,    -3738.761430108,  0.545828785 },
3417           {    0.001894e-6,     1052.268383188,  5.817167450 },
3418        /* 181, 190 */
3419           {    0.001421e-6,       20.355319399,  2.419886601 },
3420           {    0.001408e-6,    10984.192351700,  2.732084787 },
3421           {    0.001847e-6,    10873.986030480,  2.903477885 },
3422           {    0.001391e-6,    -8635.942003763,  0.593891500 },
3423           {    0.001388e-6,       -7.046236698,  1.166145902 },
3424           {    0.001810e-6,   -88860.057071188,  0.487355242 },
3425           {    0.001288e-6,    -1990.745017041,  3.913022880 },
3426           {    0.001297e-6,    23543.230504682,  3.063805171 },
3427           {    0.001335e-6,     -266.607041722,  3.995764039 },
3428           {    0.001376e-6,    10969.965257698,  5.152914309 },
3429        /* 191, 200 */
3430           {    0.001745e-6,   244287.600007027,  3.626395673 },
3431           {    0.001649e-6,    31441.677569757,  1.952049260 },
3432           {    0.001416e-6,     9225.539273283,  4.996408389 },
3433           {    0.001238e-6,     4804.209275927,  5.503379738 },
3434           {    0.001472e-6,     4590.910180489,  4.164913291 },
3435           {    0.001169e-6,     6040.347246017,  5.841719038 },
3436           {    0.001039e-6,     5540.085789459,  2.769753519 },
3437           {    0.001004e-6,     -170.672870619,  0.755008103 },
3438           {    0.001284e-6,    10575.406682942,  5.306538209 },
3439           {    0.001278e-6,       71.812653151,  4.713486491 },
3440        /* 201, 210 */
3441           {    0.001321e-6,    18209.330263660,  2.624866359 },
3442           {    0.001297e-6,    21228.392023546,  0.382603541 },
3443           {    0.000954e-6,     6282.095528923,  0.882213514 },
3444           {    0.001145e-6,     6058.731054289,  1.169483931 },
3445           {    0.000979e-6,     5547.199336460,  5.448375984 },
3446           {    0.000987e-6,    -6262.300454499,  2.656486959 },
3447           {    0.001070e-6,  -154717.609887482,  1.827624012 },
3448           {    0.000991e-6,     4701.116501708,  4.387001801 },
3449           {    0.001155e-6,      -14.227094002,  3.042700750 },
3450           {    0.001176e-6,      277.034993741,  3.335519004 },
3451        /* 211, 220 */
3452           {    0.000890e-6,    13916.019109642,  5.601498297 },
3453           {    0.000884e-6,    -1551.045222648,  1.088831705 },
3454           {    0.000876e-6,     5017.508371365,  3.969902609 },
3455           {    0.000806e-6,    15110.466119866,  5.142876744 },
3456           {    0.000773e-6,    -4136.910433516,  0.022067765 },
3457           {    0.001077e-6,      175.166059800,  1.844913056 },
3458           {    0.000954e-6,    -6284.056171060,  0.968480906 },
3459           {    0.000737e-6,     5326.786694021,  4.923831588 },
3460           {    0.000845e-6,     -433.711737877,  4.749245231 },
3461           {    0.000819e-6,     8662.240323563,  5.991247817 },
3462        /* 221, 230 */
3463           {    0.000852e-6,      199.072001436,  2.189604979 },
3464           {    0.000723e-6,    17256.631536341,  6.068719637 },
3465           {    0.000940e-6,     6037.244203762,  6.197428148 },
3466           {    0.000885e-6,    11712.955318231,  3.280414875 },
3467           {    0.000706e-6,    12559.038152982,  2.824848947 },
3468           {    0.000732e-6,     2379.164473572,  2.501813417 },
3469           {    0.000764e-6,    -6127.655450557,  2.236346329 },
3470           {    0.000908e-6,      131.541961686,  2.521257490 },
3471           {    0.000907e-6,    35371.887265976,  3.370195967 },
3472           {    0.000673e-6,     1066.495477190,  3.876512374 },
3473        /* 231, 240 */
3474           {    0.000814e-6,    17654.780539750,  4.627122566 },
3475           {    0.000630e-6,       36.027866677,  0.156368499 },
3476           {    0.000798e-6,      515.463871093,  5.151962502 },
3477           {    0.000798e-6,      148.078724426,  5.909225055 },
3478           {    0.000806e-6,      309.278322656,  6.054064447 },
3479           {    0.000607e-6,      -39.617508346,  2.839021623 },
3480           {    0.000601e-6,      412.371096874,  3.984225404 },
3481           {    0.000646e-6,    11403.676995575,  3.852959484 },
3482           {    0.000704e-6,    13521.751441591,  2.300991267 },
3483           {    0.000603e-6,   -65147.619767937,  4.140083146 },
3484        /* 241, 250 */
3485           {    0.000609e-6,    10177.257679534,  0.437122327 },
3486           {    0.000631e-6,     5767.611978898,  4.026532329 },
3487           {    0.000576e-6,    11087.285125918,  4.760293101 },
3488           {    0.000674e-6,    14945.316173554,  6.270510511 },
3489           {    0.000726e-6,     5429.879468239,  6.039606892 },
3490           {    0.000710e-6,    28766.924424484,  5.672617711 },
3491           {    0.000647e-6,    11856.218651625,  3.397132627 },
3492           {    0.000678e-6,    -5481.254918868,  6.249666675 },
3493           {    0.000618e-6,    22003.914634870,  2.466427018 },
3494           {    0.000738e-6,     6134.997125565,  2.242668890 },
3495        /* 251, 260 */
3496           {    0.000660e-6,      625.670192312,  5.864091907 },
3497           {    0.000694e-6,     3496.032826134,  2.668309141 },
3498           {    0.000531e-6,     6489.261398429,  1.681888780 },
3499           {    0.000611e-6,  -143571.324284214,  2.424978312 },
3500           {    0.000575e-6,    12043.574281889,  4.216492400 },
3501           {    0.000553e-6,    12416.588502848,  4.772158039 },
3502           {    0.000689e-6,     4686.889407707,  6.224271088 },
3503           {    0.000495e-6,     7342.457780181,  3.817285811 },
3504           {    0.000567e-6,     3634.621024518,  1.649264690 },
3505           {    0.000515e-6,    18635.928454536,  3.945345892 },
3506        /* 261, 270 */
3507           {    0.000486e-6,     -323.505416657,  4.061673868 },
3508           {    0.000662e-6,    25158.601719765,  1.794058369 },
3509           {    0.000509e-6,      846.082834751,  3.053874588 },
3510           {    0.000472e-6,   -12569.674818332,  5.112133338 },
3511           {    0.000461e-6,     6179.983075773,  0.513669325 },
3512           {    0.000641e-6,    83467.156352816,  3.210727723 },
3513           {    0.000520e-6,    10344.295065386,  2.445597761 },
3514           {    0.000493e-6,    18422.629359098,  1.676939306 },
3515           {    0.000478e-6,     1265.567478626,  5.487314569 },
3516           {    0.000472e-6,      -18.159247265,  1.999707589 },
3517        /* 271, 280 */
3518           {    0.000559e-6,    11190.377900137,  5.783236356 },
3519           {    0.000494e-6,     9623.688276691,  3.022645053 },
3520           {    0.000463e-6,     5739.157790895,  1.411223013 },
3521           {    0.000432e-6,    16858.482532933,  1.179256434 },
3522           {    0.000574e-6,    72140.628666286,  1.758191830 },
3523           {    0.000484e-6,    17267.268201691,  3.290589143 },
3524           {    0.000550e-6,     4907.302050146,  0.864024298 },
3525           {    0.000399e-6,       14.977853527,  2.094441910 },
3526           {    0.000491e-6,      224.344795702,  0.878372791 },
3527           {    0.000432e-6,    20426.571092422,  6.003829241 },
3528        /* 281, 290 */
3529           {    0.000481e-6,     5749.452731634,  4.309591964 },
3530           {    0.000480e-6,     5757.317038160,  1.142348571 },
3531           {    0.000485e-6,     6702.560493867,  0.210580917 },
3532           {    0.000426e-6,     6055.549660552,  4.274476529 },
3533           {    0.000480e-6,     5959.570433334,  5.031351030 },
3534           {    0.000466e-6,    12562.628581634,  4.959581597 },
3535           {    0.000520e-6,    39302.096962196,  4.788002889 },
3536           {    0.000458e-6,    12132.439962106,  1.880103788 },
3537           {    0.000470e-6,    12029.347187887,  1.405611197 },
3538           {    0.000416e-6,    -7477.522860216,  1.082356330 },
3539        /* 291, 300 */
3540           {    0.000449e-6,    11609.862544012,  4.179989585 },
3541           {    0.000465e-6,    17253.041107690,  0.353496295 },
3542           {    0.000362e-6,    -4535.059436924,  1.583849576 },
3543           {    0.000383e-6,    21954.157609398,  3.747376371 },
3544           {    0.000389e-6,       17.252277143,  1.395753179 },
3545           {    0.000331e-6,    18052.929543158,  0.566790582 },
3546           {    0.000430e-6,    13517.870106233,  0.685827538 },
3547           {    0.000368e-6,    -5756.908003246,  0.731374317 },
3548           {    0.000330e-6,    10557.594160824,  3.710043680 },
3549           {    0.000332e-6,    20199.094959633,  1.652901407 },
3550        /* 301, 310 */
3551           {    0.000384e-6,    11933.367960670,  5.827781531 },
3552           {    0.000387e-6,    10454.501386605,  2.541182564 },
3553           {    0.000325e-6,    15671.081759407,  2.178850542 },
3554           {    0.000318e-6,      138.517496871,  2.253253037 },
3555           {    0.000305e-6,     9388.005909415,  0.578340206 },
3556           {    0.000352e-6,     5749.861766548,  3.000297967 },
3557           {    0.000311e-6,     6915.859589305,  1.693574249 },
3558           {    0.000297e-6,    24072.921469776,  1.997249392 },
3559           {    0.000363e-6,     -640.877607382,  5.071820966 },
3560           {    0.000323e-6,    12592.450019783,  1.072262823 },
3561        /* 311, 320 */
3562           {    0.000341e-6,    12146.667056108,  4.700657997 },
3563           {    0.000290e-6,     9779.108676125,  1.812320441 },
3564           {    0.000342e-6,     6132.028180148,  4.322238614 },
3565           {    0.000329e-6,     6268.848755990,  3.033827743 },
3566           {    0.000374e-6,    17996.031168222,  3.388716544 },
3567           {    0.000285e-6,     -533.214083444,  4.687313233 },
3568           {    0.000338e-6,     6065.844601290,  0.877776108 },
3569           {    0.000276e-6,       24.298513841,  0.770299429 },
3570           {    0.000336e-6,    -2388.894020449,  5.353796034 },
3571           {    0.000290e-6,     3097.883822726,  4.075291557 },
3572        /* 321, 330 */
3573           {    0.000318e-6,      709.933048357,  5.941207518 },
3574           {    0.000271e-6,    13095.842665077,  3.208912203 },
3575           {    0.000331e-6,     6073.708907816,  4.007881169 },
3576           {    0.000292e-6,      742.990060533,  2.714333592 },
3577           {    0.000362e-6,    29088.811415985,  3.215977013 },
3578           {    0.000280e-6,    12359.966151546,  0.710872502 },
3579           {    0.000267e-6,    10440.274292604,  4.730108488 },
3580           {    0.000262e-6,      838.969287750,  1.327720272 },
3581           {    0.000250e-6,    16496.361396202,  0.898769761 },
3582           {    0.000325e-6,    20597.243963041,  0.180044365 },
3583        /* 331, 340 */
3584           {    0.000268e-6,     6148.010769956,  5.152666276 },
3585           {    0.000284e-6,     5636.065016677,  5.655385808 },
3586           {    0.000301e-6,     6080.822454817,  2.135396205 },
3587           {    0.000294e-6,     -377.373607916,  3.708784168 },
3588           {    0.000236e-6,     2118.763860378,  1.733578756 },
3589           {    0.000234e-6,     5867.523359379,  5.575209112 },
3590           {    0.000268e-6,  -226858.238553767,  0.069432392 },
3591           {    0.000265e-6,   167283.761587465,  4.369302826 },
3592           {    0.000280e-6,    28237.233459389,  5.304829118 },
3593           {    0.000292e-6,    12345.739057544,  4.096094132 },
3594        /* 341, 350 */
3595           {    0.000223e-6,    19800.945956225,  3.069327406 },
3596           {    0.000301e-6,    43232.306658416,  6.205311188 },
3597           {    0.000264e-6,    18875.525869774,  1.417263408 },
3598           {    0.000304e-6,    -1823.175188677,  3.409035232 },
3599           {    0.000301e-6,      109.945688789,  0.510922054 },
3600           {    0.000260e-6,      813.550283960,  2.389438934 },
3601           {    0.000299e-6,   316428.228673312,  5.384595078 },
3602           {    0.000211e-6,     5756.566278634,  3.789392838 },
3603           {    0.000209e-6,     5750.203491159,  1.661943545 },
3604           {    0.000240e-6,    12489.885628707,  5.684549045 },
3605        /* 351, 360 */
3606           {    0.000216e-6,     6303.851245484,  3.862942261 },
3607           {    0.000203e-6,     1581.959348283,  5.549853589 },
3608           {    0.000200e-6,     5642.198242609,  1.016115785 },
3609           {    0.000197e-6,      -70.849445304,  4.690702525 },
3610           {    0.000227e-6,     6287.008003254,  2.911891613 },
3611           {    0.000197e-6,      533.623118358,  1.048982898 },
3612           {    0.000205e-6,    -6279.485421340,  1.829362730 },
3613           {    0.000209e-6,   -10988.808157535,  2.636140084 },
3614           {    0.000208e-6,     -227.526189440,  4.127883842 },
3615           {    0.000191e-6,      415.552490612,  4.401165650 },
3616        /* 361, 370 */
3617           {    0.000190e-6,    29296.615389579,  4.175658539 },
3618           {    0.000264e-6,    66567.485864652,  4.601102551 },
3619           {    0.000256e-6,    -3646.350377354,  0.506364778 },
3620           {    0.000188e-6,    13119.721102825,  2.032195842 },
3621           {    0.000185e-6,     -209.366942175,  4.694756586 },
3622           {    0.000198e-6,    25934.124331089,  3.832703118 },
3623           {    0.000195e-6,     4061.219215394,  3.308463427 },
3624           {    0.000234e-6,     5113.487598583,  1.716090661 },
3625           {    0.000188e-6,     1478.866574064,  5.686865780 },
3626           {    0.000222e-6,    11823.161639450,  1.942386641 },
3627        /* 371, 380 */
3628           {    0.000181e-6,    10770.893256262,  1.999482059 },
3629           {    0.000171e-6,     6546.159773364,  1.182807992 },
3630           {    0.000206e-6,       70.328180442,  5.934076062 },
3631           {    0.000169e-6,    20995.392966449,  2.169080622 },
3632           {    0.000191e-6,    10660.686935042,  5.405515999 },
3633           {    0.000228e-6,    33019.021112205,  4.656985514 },
3634           {    0.000184e-6,    -4933.208440333,  3.327476868 },
3635           {    0.000220e-6,     -135.625325010,  1.765430262 },
3636           {    0.000166e-6,    23141.558382925,  3.454132746 },
3637           {    0.000191e-6,     6144.558353121,  5.020393445 },
3638        /* 381, 390 */
3639           {    0.000180e-6,     6084.003848555,  0.602182191 },
3640           {    0.000163e-6,    17782.732072784,  4.960593133 },
3641           {    0.000225e-6,    16460.333529525,  2.596451817 },
3642           {    0.000222e-6,     5905.702242076,  3.731990323 },
3643           {    0.000204e-6,      227.476132789,  5.636192701 },
3644           {    0.000159e-6,    16737.577236597,  3.600691544 },
3645           {    0.000200e-6,     6805.653268085,  0.868220961 },
3646           {    0.000187e-6,    11919.140866668,  2.629456641 },
3647           {    0.000161e-6,      127.471796607,  2.862574720 },
3648           {    0.000205e-6,     6286.666278643,  1.742882331 },
3649        /* 391, 400 */
3650           {    0.000189e-6,      153.778810485,  4.812372643 },
3651           {    0.000168e-6,    16723.350142595,  0.027860588 },
3652           {    0.000149e-6,    11720.068865232,  0.659721876 },
3653           {    0.000189e-6,     5237.921013804,  5.245313000 },
3654           {    0.000143e-6,     6709.674040867,  4.317625647 },
3655           {    0.000146e-6,     4487.817406270,  4.815297007 },
3656           {    0.000144e-6,     -664.756045130,  5.381366880 },
3657           {    0.000175e-6,     5127.714692584,  4.728443327 },
3658           {    0.000162e-6,     6254.626662524,  1.435132069 },
3659           {    0.000187e-6,    47162.516354635,  1.354371923 },
3660        /* 401, 410 */
3661           {    0.000146e-6,    11080.171578918,  3.369695406 },
3662           {    0.000180e-6,     -348.924420448,  2.490902145 },
3663           {    0.000148e-6,      151.047669843,  3.799109588 },
3664           {    0.000157e-6,     6197.248551160,  1.284375887 },
3665           {    0.000167e-6,      146.594251718,  0.759969109 },
3666           {    0.000133e-6,    -5331.357443741,  5.409701889 },
3667           {    0.000154e-6,       95.979227218,  3.366890614 },
3668           {    0.000148e-6,    -6418.140930027,  3.384104996 },
3669           {    0.000128e-6,    -6525.804453965,  3.803419985 },
3670           {    0.000130e-6,    11293.470674356,  0.939039445 },
3671        /* 411, 420 */
3672           {    0.000152e-6,    -5729.506447149,  0.734117523 },
3673           {    0.000138e-6,      210.117701700,  2.564216078 },
3674           {    0.000123e-6,     6066.595360816,  4.517099537 },
3675           {    0.000140e-6,    18451.078546566,  0.642049130 },
3676           {    0.000126e-6,    11300.584221356,  3.485280663 },
3677           {    0.000119e-6,    10027.903195729,  3.217431161 },
3678           {    0.000151e-6,     4274.518310832,  4.404359108 },
3679           {    0.000117e-6,     6072.958148291,  0.366324650 },
3680           {    0.000165e-6,    -7668.637425143,  4.298212528 },
3681           {    0.000117e-6,    -6245.048177356,  5.379518958 },
3682        /* 421, 430 */
3683           {    0.000130e-6,    -5888.449964932,  4.527681115 },
3684           {    0.000121e-6,     -543.918059096,  6.109429504 },
3685           {    0.000162e-6,     9683.594581116,  5.720092446 },
3686           {    0.000141e-6,     6219.339951688,  0.679068671 },
3687           {    0.000118e-6,    22743.409379516,  4.881123092 },
3688           {    0.000129e-6,     1692.165669502,  0.351407289 },
3689           {    0.000126e-6,     5657.405657679,  5.146592349 },
3690           {    0.000114e-6,      728.762966531,  0.520791814 },
3691           {    0.000120e-6,       52.596639600,  0.948516300 },
3692           {    0.000115e-6,       65.220371012,  3.504914846 },
3693        /* 431, 440 */
3694           {    0.000126e-6,     5881.403728234,  5.577502482 },
3695           {    0.000158e-6,   163096.180360983,  2.957128968 },
3696           {    0.000134e-6,    12341.806904281,  2.598576764 },
3697           {    0.000151e-6,    16627.370915377,  3.985702050 },
3698           {    0.000109e-6,     1368.660252845,  0.014730471 },
3699           {    0.000131e-6,     6211.263196841,  0.085077024 },
3700           {    0.000146e-6,     5792.741760812,  0.708426604 },
3701           {    0.000146e-6,      -77.750543984,  3.121576600 },
3702           {    0.000107e-6,     5341.013788022,  0.288231904 },
3703           {    0.000138e-6,     6281.591377283,  2.797450317 },
3704        /* 441, 450 */
3705           {    0.000113e-6,    -6277.552925684,  2.788904128 },
3706           {    0.000115e-6,     -525.758811831,  5.895222200 },
3707           {    0.000138e-6,     6016.468808270,  6.096188999 },
3708           {    0.000139e-6,    23539.707386333,  2.028195445 },
3709           {    0.000146e-6,    -4176.041342449,  4.660008502 },
3710           {    0.000107e-6,    16062.184526117,  4.066520001 },
3711           {    0.000142e-6,    83783.548222473,  2.936315115 },
3712           {    0.000128e-6,     9380.959672717,  3.223844306 },
3713           {    0.000135e-6,     6205.325306007,  1.638054048 },
3714           {    0.000101e-6,     2699.734819318,  5.481603249 },
3715        /* 451, 460 */
3716           {    0.000104e-6,     -568.821874027,  2.205734493 },
3717           {    0.000103e-6,     6321.103522627,  2.440421099 },
3718           {    0.000119e-6,     6321.208885629,  2.547496264 },
3719           {    0.000138e-6,     1975.492545856,  2.314608466 },
3720           {    0.000121e-6,      137.033024162,  4.539108237 },
3721           {    0.000123e-6,    19402.796952817,  4.538074405 },
3722           {    0.000119e-6,    22805.735565994,  2.869040566 },
3723           {    0.000133e-6,    64471.991241142,  6.056405489 },
3724           {    0.000129e-6,      -85.827298831,  2.540635083 },
3725           {    0.000131e-6,    13613.804277336,  4.005732868 },
3726        /* 461, 470 */
3727           {    0.000104e-6,     9814.604100291,  1.959967212 },
3728           {    0.000112e-6,    16097.679950283,  3.589026260 },
3729           {    0.000123e-6,     2107.034507542,  1.728627253 },
3730           {    0.000121e-6,    36949.230808424,  6.072332087 },
3731           {    0.000108e-6,   -12539.853380183,  3.716133846 },
3732           {    0.000113e-6,    -7875.671863624,  2.725771122 },
3733           {    0.000109e-6,     4171.425536614,  4.033338079 },
3734           {    0.000101e-6,     6247.911759770,  3.441347021 },
3735           {    0.000113e-6,     7330.728427345,  0.656372122 },
3736           {    0.000113e-6,    51092.726050855,  2.791483066 },
3737        /* 471, 480 */
3738           {    0.000106e-6,     5621.842923210,  1.815323326 },
3739           {    0.000101e-6,      111.430161497,  5.711033677 },
3740           {    0.000103e-6,      909.818733055,  2.812745443 },
3741           {    0.000101e-6,     1790.642637886,  1.965746028 },
3742 
3743        /* T */
3744           {  102.156724e-6,     6283.075849991,  4.249032005 },
3745           {    1.706807e-6,    12566.151699983,  4.205904248 },
3746           {    0.269668e-6,      213.299095438,  3.400290479 },
3747           {    0.265919e-6,      529.690965095,  5.836047367 },
3748           {    0.210568e-6,       -3.523118349,  6.262738348 },
3749           {    0.077996e-6,     5223.693919802,  4.670344204 },
3750        /* 481, 490 */
3751           {    0.054764e-6,     1577.343542448,  4.534800170 },
3752           {    0.059146e-6,       26.298319800,  1.083044735 },
3753           {    0.034420e-6,     -398.149003408,  5.980077351 },
3754           {    0.032088e-6,    18849.227549974,  4.162913471 },
3755           {    0.033595e-6,     5507.553238667,  5.980162321 },
3756           {    0.029198e-6,     5856.477659115,  0.623811863 },
3757           {    0.027764e-6,      155.420399434,  3.745318113 },
3758           {    0.025190e-6,     5746.271337896,  2.980330535 },
3759           {    0.022997e-6,     -796.298006816,  1.174411803 },
3760           {    0.024976e-6,     5760.498431898,  2.467913690 },
3761        /* 491, 500 */
3762           {    0.021774e-6,      206.185548437,  3.854787540 },
3763           {    0.017925e-6,     -775.522611324,  1.092065955 },
3764           {    0.013794e-6,      426.598190876,  2.699831988 },
3765           {    0.013276e-6,     6062.663207553,  5.845801920 },
3766           {    0.011774e-6,    12036.460734888,  2.292832062 },
3767           {    0.012869e-6,     6076.890301554,  5.333425680 },
3768           {    0.012152e-6,     1059.381930189,  6.222874454 },
3769           {    0.011081e-6,       -7.113547001,  5.154724984 },
3770           {    0.010143e-6,     4694.002954708,  4.044013795 },
3771           {    0.009357e-6,     5486.777843175,  3.416081409 },
3772        /* 501, 510 */
3773           {    0.010084e-6,      522.577418094,  0.749320262 },
3774           {    0.008587e-6,    10977.078804699,  2.777152598 },
3775           {    0.008628e-6,     6275.962302991,  4.562060226 },
3776           {    0.008158e-6,     -220.412642439,  5.806891533 },
3777           {    0.007746e-6,     2544.314419883,  1.603197066 },
3778           {    0.007670e-6,     2146.165416475,  3.000200440 },
3779           {    0.007098e-6,       74.781598567,  0.443725817 },
3780           {    0.006180e-6,     -536.804512095,  1.302642751 },
3781           {    0.005818e-6,     5088.628839767,  4.827723531 },
3782           {    0.004945e-6,    -6286.598968340,  0.268305170 },
3783        /* 511, 520 */
3784           {    0.004774e-6,     1349.867409659,  5.808636673 },
3785           {    0.004687e-6,     -242.728603974,  5.154890570 },
3786           {    0.006089e-6,     1748.016413067,  4.403765209 },
3787           {    0.005975e-6,    -1194.447010225,  2.583472591 },
3788           {    0.004229e-6,      951.718406251,  0.931172179 },
3789           {    0.005264e-6,      553.569402842,  2.336107252 },
3790           {    0.003049e-6,     5643.178563677,  1.362634430 },
3791           {    0.002974e-6,     6812.766815086,  1.583012668 },
3792           {    0.003403e-6,    -2352.866153772,  2.552189886 },
3793           {    0.003030e-6,      419.484643875,  5.286473844 },
3794        /* 521, 530 */
3795           {    0.003210e-6,       -7.046236698,  1.863796539 },
3796           {    0.003058e-6,     9437.762934887,  4.226420633 },
3797           {    0.002589e-6,    12352.852604545,  1.991935820 },
3798           {    0.002927e-6,     5216.580372801,  2.319951253 },
3799           {    0.002425e-6,     5230.807466803,  3.084752833 },
3800           {    0.002656e-6,     3154.687084896,  2.487447866 },
3801           {    0.002445e-6,    10447.387839604,  2.347139160 },
3802           {    0.002990e-6,     4690.479836359,  6.235872050 },
3803           {    0.002890e-6,     5863.591206116,  0.095197563 },
3804           {    0.002498e-6,     6438.496249426,  2.994779800 },
3805        /* 531, 540 */
3806           {    0.001889e-6,     8031.092263058,  3.569003717 },
3807           {    0.002567e-6,      801.820931124,  3.425611498 },
3808           {    0.001803e-6,   -71430.695617928,  2.192295512 },
3809           {    0.001782e-6,        3.932153263,  5.180433689 },
3810           {    0.001694e-6,    -4705.732307544,  4.641779174 },
3811           {    0.001704e-6,    -1592.596013633,  3.997097652 },
3812           {    0.001735e-6,     5849.364112115,  0.417558428 },
3813           {    0.001643e-6,     8429.241266467,  2.180619584 },
3814           {    0.001680e-6,       38.133035638,  4.164529426 },
3815           {    0.002045e-6,     7084.896781115,  0.526323854 },
3816        /* 541, 550 */
3817           {    0.001458e-6,     4292.330832950,  1.356098141 },
3818           {    0.001437e-6,       20.355319399,  3.895439360 },
3819           {    0.001738e-6,     6279.552731642,  0.087484036 },
3820           {    0.001367e-6,    14143.495242431,  3.987576591 },
3821           {    0.001344e-6,     7234.794256242,  0.090454338 },
3822           {    0.001438e-6,    11499.656222793,  0.974387904 },
3823           {    0.001257e-6,     6836.645252834,  1.509069366 },
3824           {    0.001358e-6,    11513.883316794,  0.495572260 },
3825           {    0.001628e-6,     7632.943259650,  4.968445721 },
3826           {    0.001169e-6,      103.092774219,  2.838496795 },
3827        /* 551, 560 */
3828           {    0.001162e-6,     4164.311989613,  3.408387778 },
3829           {    0.001092e-6,     6069.776754553,  3.617942651 },
3830           {    0.001008e-6,    17789.845619785,  0.286350174 },
3831           {    0.001008e-6,      639.897286314,  1.610762073 },
3832           {    0.000918e-6,    10213.285546211,  5.532798067 },
3833           {    0.001011e-6,    -6256.777530192,  0.661826484 },
3834           {    0.000753e-6,    16730.463689596,  3.905030235 },
3835           {    0.000737e-6,    11926.254413669,  4.641956361 },
3836           {    0.000694e-6,     3340.612426700,  2.111120332 },
3837           {    0.000701e-6,     3894.181829542,  2.760823491 },
3838        /* 561, 570 */
3839           {    0.000689e-6,     -135.065080035,  4.768800780 },
3840           {    0.000700e-6,    13367.972631107,  5.760439898 },
3841           {    0.000664e-6,     6040.347246017,  1.051215840 },
3842           {    0.000654e-6,     5650.292110678,  4.911332503 },
3843           {    0.000788e-6,     6681.224853400,  4.699648011 },
3844           {    0.000628e-6,     5333.900241022,  5.024608847 },
3845           {    0.000755e-6,     -110.206321219,  4.370971253 },
3846           {    0.000628e-6,     6290.189396992,  3.660478857 },
3847           {    0.000635e-6,    25132.303399966,  4.121051532 },
3848           {    0.000534e-6,     5966.683980335,  1.173284524 },
3849        /* 571, 580 */
3850           {    0.000543e-6,     -433.711737877,  0.345585464 },
3851           {    0.000517e-6,    -1990.745017041,  5.414571768 },
3852           {    0.000504e-6,     5767.611978898,  2.328281115 },
3853           {    0.000485e-6,     5753.384884897,  1.685874771 },
3854           {    0.000463e-6,     7860.419392439,  5.297703006 },
3855           {    0.000604e-6,      515.463871093,  0.591998446 },
3856           {    0.000443e-6,    12168.002696575,  4.830881244 },
3857           {    0.000570e-6,      199.072001436,  3.899190272 },
3858           {    0.000465e-6,    10969.965257698,  0.476681802 },
3859           {    0.000424e-6,    -7079.373856808,  1.112242763 },
3860        /* 581, 590 */
3861           {    0.000427e-6,      735.876513532,  1.994214480 },
3862           {    0.000478e-6,    -6127.655450557,  3.778025483 },
3863           {    0.000414e-6,    10973.555686350,  5.441088327 },
3864           {    0.000512e-6,     1589.072895284,  0.107123853 },
3865           {    0.000378e-6,    10984.192351700,  0.915087231 },
3866           {    0.000402e-6,    11371.704689758,  4.107281715 },
3867           {    0.000453e-6,     9917.696874510,  1.917490952 },
3868           {    0.000395e-6,      149.563197135,  2.763124165 },
3869           {    0.000371e-6,     5739.157790895,  3.112111866 },
3870           {    0.000350e-6,    11790.629088659,  0.440639857 },
3871        /* 591, 600 */
3872           {    0.000356e-6,     6133.512652857,  5.444568842 },
3873           {    0.000344e-6,      412.371096874,  5.676832684 },
3874           {    0.000383e-6,      955.599741609,  5.559734846 },
3875           {    0.000333e-6,     6496.374945429,  0.261537984 },
3876           {    0.000340e-6,     6055.549660552,  5.975534987 },
3877           {    0.000334e-6,     1066.495477190,  2.335063907 },
3878           {    0.000399e-6,    11506.769769794,  5.321230910 },
3879           {    0.000314e-6,    18319.536584880,  2.313312404 },
3880           {    0.000424e-6,     1052.268383188,  1.211961766 },
3881           {    0.000307e-6,       63.735898303,  3.169551388 },
3882        /* 601, 610 */
3883           {    0.000329e-6,       29.821438149,  6.106912080 },
3884           {    0.000357e-6,     6309.374169791,  4.223760346 },
3885           {    0.000312e-6,    -3738.761430108,  2.180556645 },
3886           {    0.000301e-6,      309.278322656,  1.499984572 },
3887           {    0.000268e-6,    12043.574281889,  2.447520648 },
3888           {    0.000257e-6,    12491.370101415,  3.662331761 },
3889           {    0.000290e-6,      625.670192312,  1.272834584 },
3890           {    0.000256e-6,     5429.879468239,  1.913426912 },
3891           {    0.000339e-6,     3496.032826134,  4.165930011 },
3892           {    0.000283e-6,     3930.209696220,  4.325565754 },
3893        /* 611, 620 */
3894           {    0.000241e-6,    12528.018664345,  3.832324536 },
3895           {    0.000304e-6,     4686.889407707,  1.612348468 },
3896           {    0.000259e-6,    16200.772724501,  3.470173146 },
3897           {    0.000238e-6,    12139.553509107,  1.147977842 },
3898           {    0.000236e-6,     6172.869528772,  3.776271728 },
3899           {    0.000296e-6,    -7058.598461315,  0.460368852 },
3900           {    0.000306e-6,    10575.406682942,  0.554749016 },
3901           {    0.000251e-6,    17298.182327326,  0.834332510 },
3902           {    0.000290e-6,     4732.030627343,  4.759564091 },
3903           {    0.000261e-6,     5884.926846583,  0.298259862 },
3904        /* 621, 630 */
3905           {    0.000249e-6,     5547.199336460,  3.749366406 },
3906           {    0.000213e-6,    11712.955318231,  5.415666119 },
3907           {    0.000223e-6,     4701.116501708,  2.703203558 },
3908           {    0.000268e-6,     -640.877607382,  0.283670793 },
3909           {    0.000209e-6,     5636.065016677,  1.238477199 },
3910           {    0.000193e-6,    10177.257679534,  1.943251340 },
3911           {    0.000182e-6,     6283.143160294,  2.456157599 },
3912           {    0.000184e-6,     -227.526189440,  5.888038582 },
3913           {    0.000182e-6,    -6283.008539689,  0.241332086 },
3914           {    0.000228e-6,    -6284.056171060,  2.657323816 },
3915        /* 631, 640 */
3916           {    0.000166e-6,     7238.675591600,  5.930629110 },
3917           {    0.000167e-6,     3097.883822726,  5.570955333 },
3918           {    0.000159e-6,     -323.505416657,  5.786670700 },
3919           {    0.000154e-6,    -4136.910433516,  1.517805532 },
3920           {    0.000176e-6,    12029.347187887,  3.139266834 },
3921           {    0.000167e-6,    12132.439962106,  3.556352289 },
3922           {    0.000153e-6,      202.253395174,  1.463313961 },
3923           {    0.000157e-6,    17267.268201691,  1.586837396 },
3924           {    0.000142e-6,    83996.847317911,  0.022670115 },
3925           {    0.000152e-6,    17260.154654690,  0.708528947 },
3926        /* 641, 650 */
3927           {    0.000144e-6,     6084.003848555,  5.187075177 },
3928           {    0.000135e-6,     5756.566278634,  1.993229262 },
3929           {    0.000134e-6,     5750.203491159,  3.457197134 },
3930           {    0.000144e-6,     5326.786694021,  6.066193291 },
3931           {    0.000160e-6,    11015.106477335,  1.710431974 },
3932           {    0.000133e-6,     3634.621024518,  2.836451652 },
3933           {    0.000134e-6,    18073.704938650,  5.453106665 },
3934           {    0.000134e-6,     1162.474704408,  5.326898811 },
3935           {    0.000128e-6,     5642.198242609,  2.511652591 },
3936           {    0.000160e-6,      632.783739313,  5.628785365 },
3937        /* 651, 660 */
3938           {    0.000132e-6,    13916.019109642,  0.819294053 },
3939           {    0.000122e-6,    14314.168113050,  5.677408071 },
3940           {    0.000125e-6,    12359.966151546,  5.251984735 },
3941           {    0.000121e-6,     5749.452731634,  2.210924603 },
3942           {    0.000136e-6,     -245.831646229,  1.646502367 },
3943           {    0.000120e-6,     5757.317038160,  3.240883049 },
3944           {    0.000134e-6,    12146.667056108,  3.059480037 },
3945           {    0.000137e-6,     6206.809778716,  1.867105418 },
3946           {    0.000141e-6,    17253.041107690,  2.069217456 },
3947           {    0.000129e-6,    -7477.522860216,  2.781469314 },
3948        /* 661, 670 */
3949           {    0.000116e-6,     5540.085789459,  4.281176991 },
3950           {    0.000116e-6,     9779.108676125,  3.320925381 },
3951           {    0.000129e-6,     5237.921013804,  3.497704076 },
3952           {    0.000113e-6,     5959.570433334,  0.983210840 },
3953           {    0.000122e-6,     6282.095528923,  2.674938860 },
3954           {    0.000140e-6,      -11.045700264,  4.957936982 },
3955           {    0.000108e-6,    23543.230504682,  1.390113589 },
3956           {    0.000106e-6,   -12569.674818332,  0.429631317 },
3957           {    0.000110e-6,     -266.607041722,  5.501340197 },
3958           {    0.000115e-6,    12559.038152982,  4.691456618 },
3959        /* 671, 680 */
3960           {    0.000134e-6,    -2388.894020449,  0.577313584 },
3961           {    0.000109e-6,    10440.274292604,  6.218148717 },
3962           {    0.000102e-6,     -543.918059096,  1.477842615 },
3963           {    0.000108e-6,    21228.392023546,  2.237753948 },
3964           {    0.000101e-6,    -4535.059436924,  3.100492232 },
3965           {    0.000103e-6,       76.266071276,  5.594294322 },
3966           {    0.000104e-6,      949.175608970,  5.674287810 },
3967           {    0.000101e-6,    13517.870106233,  2.196632348 },
3968           {    0.000100e-6,    11933.367960670,  4.056084160 },
3969 
3970        /* T^2 */
3971           {    4.322990e-6,     6283.075849991,  2.642893748 },
3972        /* 681, 690 */
3973           {    0.406495e-6,        0.000000000,  4.712388980 },
3974           {    0.122605e-6,    12566.151699983,  2.438140634 },
3975           {    0.019476e-6,      213.299095438,  1.642186981 },
3976           {    0.016916e-6,      529.690965095,  4.510959344 },
3977           {    0.013374e-6,       -3.523118349,  1.502210314 },
3978           {    0.008042e-6,       26.298319800,  0.478549024 },
3979           {    0.007824e-6,      155.420399434,  5.254710405 },
3980           {    0.004894e-6,     5746.271337896,  4.683210850 },
3981           {    0.004875e-6,     5760.498431898,  0.759507698 },
3982           {    0.004416e-6,     5223.693919802,  6.028853166 },
3983        /* 691, 700 */
3984           {    0.004088e-6,       -7.113547001,  0.060926389 },
3985           {    0.004433e-6,    77713.771467920,  3.627734103 },
3986           {    0.003277e-6,    18849.227549974,  2.327912542 },
3987           {    0.002703e-6,     6062.663207553,  1.271941729 },
3988           {    0.003435e-6,     -775.522611324,  0.747446224 },
3989           {    0.002618e-6,     6076.890301554,  3.633715689 },
3990           {    0.003146e-6,      206.185548437,  5.647874613 },
3991           {    0.002544e-6,     1577.343542448,  6.232904270 },
3992           {    0.002218e-6,     -220.412642439,  1.309509946 },
3993           {    0.002197e-6,     5856.477659115,  2.407212349 },
3994        /* 701, 710 */
3995           {    0.002897e-6,     5753.384884897,  5.863842246 },
3996           {    0.001766e-6,      426.598190876,  0.754113147 },
3997           {    0.001738e-6,     -796.298006816,  2.714942671 },
3998           {    0.001695e-6,      522.577418094,  2.629369842 },
3999           {    0.001584e-6,     5507.553238667,  1.341138229 },
4000           {    0.001503e-6,     -242.728603974,  0.377699736 },
4001           {    0.001552e-6,     -536.804512095,  2.904684667 },
4002           {    0.001370e-6,     -398.149003408,  1.265599125 },
4003           {    0.001889e-6,    -5573.142801634,  4.413514859 },
4004           {    0.001722e-6,     6069.776754553,  2.445966339 },
4005        /* 711, 720 */
4006           {    0.001124e-6,     1059.381930189,  5.041799657 },
4007           {    0.001258e-6,      553.569402842,  3.849557278 },
4008           {    0.000831e-6,      951.718406251,  2.471094709 },
4009           {    0.000767e-6,     4694.002954708,  5.363125422 },
4010           {    0.000756e-6,     1349.867409659,  1.046195744 },
4011           {    0.000775e-6,      -11.045700264,  0.245548001 },
4012           {    0.000597e-6,     2146.165416475,  4.543268798 },
4013           {    0.000568e-6,     5216.580372801,  4.178853144 },
4014           {    0.000711e-6,     1748.016413067,  5.934271972 },
4015           {    0.000499e-6,    12036.460734888,  0.624434410 },
4016        /* 721, 730 */
4017           {    0.000671e-6,    -1194.447010225,  4.136047594 },
4018           {    0.000488e-6,     5849.364112115,  2.209679987 },
4019           {    0.000621e-6,     6438.496249426,  4.518860804 },
4020           {    0.000495e-6,    -6286.598968340,  1.868201275 },
4021           {    0.000456e-6,     5230.807466803,  1.271231591 },
4022           {    0.000451e-6,     5088.628839767,  0.084060889 },
4023           {    0.000435e-6,     5643.178563677,  3.324456609 },
4024           {    0.000387e-6,    10977.078804699,  4.052488477 },
4025           {    0.000547e-6,   161000.685737473,  2.841633844 },
4026           {    0.000522e-6,     3154.687084896,  2.171979966 },
4027        /* 731, 740 */
4028           {    0.000375e-6,     5486.777843175,  4.983027306 },
4029           {    0.000421e-6,     5863.591206116,  4.546432249 },
4030           {    0.000439e-6,     7084.896781115,  0.522967921 },
4031           {    0.000309e-6,     2544.314419883,  3.172606705 },
4032           {    0.000347e-6,     4690.479836359,  1.479586566 },
4033           {    0.000317e-6,      801.820931124,  3.553088096 },
4034           {    0.000262e-6,      419.484643875,  0.606635550 },
4035           {    0.000248e-6,     6836.645252834,  3.014082064 },
4036           {    0.000245e-6,    -1592.596013633,  5.519526220 },
4037           {    0.000225e-6,     4292.330832950,  2.877956536 },
4038        /* 741, 750 */
4039           {    0.000214e-6,     7234.794256242,  1.605227587 },
4040           {    0.000205e-6,     5767.611978898,  0.625804796 },
4041           {    0.000180e-6,    10447.387839604,  3.499954526 },
4042           {    0.000229e-6,      199.072001436,  5.632304604 },
4043           {    0.000214e-6,      639.897286314,  5.960227667 },
4044           {    0.000175e-6,     -433.711737877,  2.162417992 },
4045           {    0.000209e-6,      515.463871093,  2.322150893 },
4046           {    0.000173e-6,     6040.347246017,  2.556183691 },
4047           {    0.000184e-6,     6309.374169791,  4.732296790 },
4048           {    0.000227e-6,   149854.400134205,  5.385812217 },
4049        /* 751, 760 */
4050           {    0.000154e-6,     8031.092263058,  5.120720920 },
4051           {    0.000151e-6,     5739.157790895,  4.815000443 },
4052           {    0.000197e-6,     7632.943259650,  0.222827271 },
4053           {    0.000197e-6,       74.781598567,  3.910456770 },
4054           {    0.000138e-6,     6055.549660552,  1.397484253 },
4055           {    0.000149e-6,    -6127.655450557,  5.333727496 },
4056           {    0.000137e-6,     3894.181829542,  4.281749907 },
4057           {    0.000135e-6,     9437.762934887,  5.979971885 },
4058           {    0.000139e-6,    -2352.866153772,  4.715630782 },
4059           {    0.000142e-6,     6812.766815086,  0.513330157 },
4060        /* 761, 770 */
4061           {    0.000120e-6,    -4705.732307544,  0.194160689 },
4062           {    0.000131e-6,   -71430.695617928,  0.000379226 },
4063           {    0.000124e-6,     6279.552731642,  2.122264908 },
4064           {    0.000108e-6,    -6256.777530192,  0.883445696 },
4065 
4066        /* T^3 */
4067           {    0.143388e-6,     6283.075849991,  1.131453581 },
4068           {    0.006671e-6,    12566.151699983,  0.775148887 },
4069           {    0.001480e-6,      155.420399434,  0.480016880 },
4070           {    0.000934e-6,      213.299095438,  6.144453084 },
4071           {    0.000795e-6,      529.690965095,  2.941595619 },
4072           {    0.000673e-6,     5746.271337896,  0.120415406 },
4073        /* 771, 780 */
4074           {    0.000672e-6,     5760.498431898,  5.317009738 },
4075           {    0.000389e-6,     -220.412642439,  3.090323467 },
4076           {    0.000373e-6,     6062.663207553,  3.003551964 },
4077           {    0.000360e-6,     6076.890301554,  1.918913041 },
4078           {    0.000316e-6,      -21.340641002,  5.545798121 },
4079           {    0.000315e-6,     -242.728603974,  1.884932563 },
4080           {    0.000278e-6,      206.185548437,  1.266254859 },
4081           {    0.000238e-6,     -536.804512095,  4.532664830 },
4082           {    0.000185e-6,      522.577418094,  4.578313856 },
4083           {    0.000245e-6,    18849.227549974,  0.587467082 },
4084        /* 781, 787 */
4085           {    0.000180e-6,      426.598190876,  5.151178553 },
4086           {    0.000200e-6,      553.569402842,  5.355983739 },
4087           {    0.000141e-6,     5223.693919802,  1.336556009 },
4088           {    0.000104e-6,     5856.477659115,  4.239842759 },
4089 
4090        /* T^4 */
4091           {    0.003826e-6,     6283.075849991,  5.705257275 },
4092           {    0.000303e-6,    12566.151699983,  5.407132842 },
4093           {    0.000209e-6,      155.420399434,  1.989815753 }
4094        };
4095 
4096 
4097     /* Time since J2000.0 in Julian millennia. */
4098        t = ((date1 - DJ00) + date2) / DJM;
4099 
4100     /* ================= */
4101     /* Topocentric terms */
4102     /* ================= */
4103 
4104     /* Convert UT to local solar time in radians. */
4105        tsol = fmod(ut, 1.0) * D2PI + elong;
4106 
4107     /* FUNDAMENTAL ARGUMENTS:  Simon et al. 1994. */
4108 
4109     /* Combine time argument (millennia) with deg/arcsec factor. */
4110        w = t / 3600.0;
4111 
4112     /* Sun Mean Longitude. */
4113        elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * DD2R;
4114 
4115     /* Sun Mean Anomaly. */
4116        emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * DD2R;
4117 
4118     /* Mean Elongation of Moon from Sun. */
4119        d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * DD2R;
4120 
4121     /* Mean Longitude of Jupiter. */
4122        elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * DD2R;
4123 
4124     /* Mean Longitude of Saturn. */
4125        els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * DD2R;
4126 
4127     /* TOPOCENTRIC TERMS:  Moyer 1981 and Murray 1983. */
4128        wt =   +  0.00029e-10 * u * sin(tsol + elsun - els)
4129               +  0.00100e-10 * u * sin(tsol - 2.0 * emsun)
4130               +  0.00133e-10 * u * sin(tsol - d)
4131               +  0.00133e-10 * u * sin(tsol + elsun - elj)
4132               -  0.00229e-10 * u * sin(tsol + 2.0 * elsun + emsun)
4133               -  0.02200e-10 * v * cos(elsun + emsun)
4134               +  0.05312e-10 * u * sin(tsol - emsun)
4135               -  0.13677e-10 * u * sin(tsol + 2.0 * elsun)
4136               -  1.31840e-10 * v * cos(elsun)
4137               +  3.17679e-10 * u * sin(tsol);
4138 
4139     /* ===================== */
4140     /* Fairhead et al. model */
4141     /* ===================== */
4142 
4143     /* T**0 */
4144        w0 = 0;
4145        for (j = 473; j >= 0; j--) {
4146           w0 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4147        }
4148 
4149     /* T**1 */
4150        w1 = 0;
4151        for (j = 678; j >= 474; j--) {
4152           w1 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4153        }
4154 
4155     /* T**2 */
4156        w2 = 0;
4157        for (j = 763; j >= 679; j--) {
4158           w2 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4159        }
4160 
4161     /* T**3 */
4162        w3 = 0;
4163        for (j = 783; j >= 764; j--) {
4164           w3 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4165        }
4166 
4167     /* T**4 */
4168        w4 = 0;
4169        for (j = 786; j >= 784; j--) {
4170           w4 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4171        }
4172 
4173     /* Multiply by powers of T and combine. */
4174        wf = t * (t * (t * (t * w4 + w3) + w2) + w1) + w0;
4175 
4176     /* Adjustments to use JPL planetary masses instead of IAU. */
4177        wj =   0.00065e-6 * sin(6069.776754 * t + 4.021194) +
4178               0.00033e-6 * sin( 213.299095 * t + 5.543132) +
4179             (-0.00196e-6 * sin(6208.294251 * t + 5.696701)) +
4180             (-0.00173e-6 * sin(  74.781599 * t + 2.435900)) +
4181               0.03638e-6 * t * t;
4182 
4183     /* ============ */
4184     /* Final result */
4185     /* ============ */
4186 
4187     /* TDB-TT in seconds. */
4188        w = wt + wf + wj;
4189 
4190        return w;
4191 
4192         }
4193     
4194 
4195     /**
4196     *  The equation of the equinoxes, compatible with IAU 2000 resolutions,
4197     *  given the nutation in longitude and the mean obliquity.
4198     *
4199     *<p>This function is derived from the International Astronomical Union's
4200     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4201     *
4202     *<p>Status:  canonical model.
4203     *
4204     *<!-- Given: -->
4205     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4206     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4207     *     @param epsa          double     mean obliquity (Note 2)
4208     *     @param dpsi          double     nutation in longitude (Note 3)
4209     *
4210     * <!-- Returned (function value): -->
4211     *  @return double    equation of the equinoxes (Note 4)
4212     *
4213     * <p>Notes:
4214     * <ol>
4215     *
4216     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4217     *     convenient way between the two arguments.  For example,
4218     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4219     *     among others:
4220     *<pre>
4221     *            date1          date2
4222     *
4223     *         2450123.7           0.0       (JD method)
4224     *         2451545.0       -1421.3       (J2000 method)
4225     *         2400000.5       50123.2       (MJD method)
4226     *         2450123.5           0.2       (date &amp; time method)
4227     *</pre>
4228     *     The JD method is the most natural and convenient to use in
4229     *     cases where the loss of several decimal digits of resolution
4230     *     is acceptable.  The J2000 method is best matched to the way
4231     *     the argument is handled internally and will deliver the
4232     *     optimum resolution.  The MJD method and the date &amp; time methods
4233     *     are both good compromises between resolution and convenience.
4234     *
4235     * <li> The obliquity, in radians, is mean of date.
4236     *
4237     * <li> The result, which is in radians, operates in the following sense:
4238     *
4239     *        Greenwich apparent ST = GMST + equation of the equinoxes
4240     *
4241     * <li> The result is compatible with the IAU 2000 resolutions.  For
4242     *     further details, see IERS Conventions 2003 and Capitaine et al.
4243     *     (2002).
4244     *</ol>
4245     *<p>Called:<ul>
4246     *     <li>{@link #jauEect00} equation of the equinoxes complementary terms
4247     * </ul>
4248     *
4249     *
4250     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4251     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4252     *     Astrophysics, 406, 1135-1149 (2003)
4253     *
4254     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4255     *     IERS Technical Note No. 32, BKG (2004)
4256     *
4257     *@version 2008 May 16
4258     *
4259     *  @since Release 20101201
4260     *
4261     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4262     */
4263     public static double jauEe00(double date1, double date2, double epsa, double dpsi)
4264     {
4265        double ee;
4266 
4267 
4268     /* Equation of the equinoxes. */
4269        ee = dpsi * cos(epsa) + jauEect00(date1, date2);
4270 
4271        return ee;
4272 
4273         }
4274     
4275 
4276     /**
4277     *  Equation of the equinoxes, compatible with IAU 2000 resolutions.
4278     *
4279     *<p>This function is derived from the International Astronomical Union's
4280     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4281     *
4282     *<p>Status:  support function.
4283     *
4284     *<!-- Given: -->
4285     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4286     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4287     *
4288     * <!-- Returned (function value): -->
4289     *  @return double    equation of the equinoxes (Note 2)
4290     *
4291     * <p>Notes:
4292     * <ol>
4293     *
4294     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4295     *     convenient way between the two arguments.  For example,
4296     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4297     *     among others:
4298     *<pre>
4299     *            date1          date2
4300     *
4301     *         2450123.7           0.0       (JD method)
4302     *         2451545.0       -1421.3       (J2000 method)
4303     *         2400000.5       50123.2       (MJD method)
4304     *         2450123.5           0.2       (date &amp; time method)
4305     *</pre>
4306     *     The JD method is the most natural and convenient to use in
4307     *     cases where the loss of several decimal digits of resolution
4308     *     is acceptable.  The J2000 method is best matched to the way
4309     *     the argument is handled internally and will deliver the
4310     *     optimum resolution.  The MJD method and the date &amp; time methods
4311     *     are both good compromises between resolution and convenience.
4312     *
4313     * <li> The result, which is in radians, operates in the following sense:
4314     *
4315     *        Greenwich apparent ST = GMST + equation of the equinoxes
4316     *
4317     * <li> The result is compatible with the IAU 2000 resolutions.  For
4318     *     further details, see IERS Conventions 2003 and Capitaine et al.
4319     *     (2002).
4320     *</ol>
4321     *<p>Called:<ul>
4322     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4323     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4324     *     <li>{@link #jauNut00a} nutation, IAU 2000A
4325     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4326     * </ul>
4327     *<p>References:
4328     *
4329     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4330     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4331     *     Astrophysics, 406, 1135-1149 (2003).
4332     *
4333     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4334     *     IERS Technical Note No. 32, BKG (2004).
4335     *
4336     *@version 2008 May 16
4337     *
4338     *  @since Release 20101201
4339     *
4340     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4341     */
4342     public static double jauEe00a(double date1, double date2)
4343     {
4344        double epsa,  ee;
4345 
4346 
4347     /* IAU 2000 precession-rate adjustments. */
4348        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4349 
4350     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4351        epsa = jauObl80(date1, date2) + nutd.depspr;
4352 
4353     /* Nutation in longitude. */
4354        NutationTerms nut = jauNut00a(date1, date2);
4355 
4356     /* Equation of the equinoxes. */
4357        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4358 
4359        return ee;
4360 
4361         }
4362     
4363 
4364     /**
4365     *  Equation of the equinoxes, compatible with IAU 2000 resolutions but
4366     *  using the truncated nutation model IAU 2000B.
4367     *
4368     *<p>This function is derived from the International Astronomical Union's
4369     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4370     *
4371     *<p>Status:  support function.
4372     *
4373     *<!-- Given: -->
4374     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4375     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4376     *
4377     * <!-- Returned (function value): -->
4378     *  @return double    equation of the equinoxes (Note 2)
4379     *
4380     * <p>Notes:
4381     * <ol>
4382     *
4383     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4384     *     convenient way between the two arguments.  For example,
4385     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4386     *     among others:
4387     *<pre>
4388     *            date1          date2
4389     *
4390     *         2450123.7           0.0       (JD method)
4391     *         2451545.0       -1421.3       (J2000 method)
4392     *         2400000.5       50123.2       (MJD method)
4393     *         2450123.5           0.2       (date &amp; time method)
4394     *</pre>
4395     *     The JD method is the most natural and convenient to use in
4396     *     cases where the loss of several decimal digits of resolution
4397     *     is acceptable.  The J2000 method is best matched to the way
4398     *     the argument is handled internally and will deliver the
4399     *     optimum resolution.  The MJD method and the date &amp; time methods
4400     *     are both good compromises between resolution and convenience.
4401     *
4402     * <li> The result, which is in radians, operates in the following sense:
4403     *
4404     *        Greenwich apparent ST = GMST + equation of the equinoxes
4405     *
4406     * <li> The result is compatible with the IAU 2000 resolutions except
4407     *     that accuracy has been compromised for the sake of speed.  For
4408     *     further details, see McCarthy &amp; Luzum (2001), IERS Conventions
4409     *     2003 and Capitaine et al. (2003).
4410     *</ol>
4411     *<p>Called:<ul>
4412     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4413     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4414     *     <li>{@link #jauNut00b} nutation, IAU 2000B
4415     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4416     * </ul>
4417     *
4418     *
4419     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4420     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4421     *     Astrophysics, 406, 1135-1149 (2003)
4422     *
4423     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
4424     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
4425     *     Dynamical Astronomy, 85, 37-49 (2003)
4426     *
4427     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4428     *     IERS Technical Note No. 32, BKG (2004)
4429     *
4430     *@version 2008 May 18
4431     *
4432     *  @since Release 20101201
4433     *
4434     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4435     */
4436     public static  double jauEe00b(double date1, double date2)
4437     {
4438        double  ee;
4439 
4440 
4441     /* IAU 2000 precession-rate adjustments. */
4442        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4443 
4444     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4445        double epsa = jauObl80(date1, date2) + nutd.depspr;
4446 
4447     /* Nutation in longitude. dpsi, deps*/
4448        NutationTerms nut = jauNut00b(date1, date2 );
4449 
4450     /* Equation of the equinoxes. */
4451        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4452 
4453        return ee;
4454 
4455         }
4456  
4457     /**
4458     *  Equation of the equinoxes, compatible with IAU 2000 resolutions and
4459     *  IAU 2006/2000A precession-nutation.
4460     *
4461     *<p>This function is derived from the International Astronomical Union's
4462     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4463     *
4464     *<p>Status:  support function.
4465     *
4466     *<!-- Given: -->
4467     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4468     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4469     *
4470     * <!-- Returned (function value): -->
4471     *  @return double    equation of the equinoxes (Note 2)
4472     *
4473     * <p>Notes:
4474     * <ol>
4475     *
4476     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4477     *     convenient way between the two arguments.  For example,
4478     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4479     *     among others:
4480     *<pre>
4481     *            date1          date2
4482     *
4483     *         2450123.7           0.0       (JD method)
4484     *         2451545.0       -1421.3       (J2000 method)
4485     *         2400000.5       50123.2       (MJD method)
4486     *         2450123.5           0.2       (date &amp; time method)
4487     *</pre>
4488     *     The JD method is the most natural and convenient to use in
4489     *     cases where the loss of several decimal digits of resolution
4490     *     is acceptable.  The J2000 method is best matched to the way
4491     *     the argument is handled internally and will deliver the
4492     *     optimum resolution.  The MJD method and the date &amp; time methods
4493     *     are both good compromises between resolution and convenience.
4494     *
4495     * <li> The result, which is in radians, operates in the following sense:
4496     *
4497     *        Greenwich apparent ST = GMST + equation of the equinoxes
4498     *</ol>
4499     *<p>Called:<ul>
4500     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
4501     *     <li>{@link #jauGst06a} Greenwich apparent sidereal time, IAU 2006/2000A
4502     *     <li>{@link #jauGmst06} Greenwich mean sidereal time, IAU 2006
4503     * </ul>
4504     *<p>Reference:
4505     *
4506     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
4507     *     IERS Technical Note No. 32, BKG
4508     *
4509     *@version 2008 May 18
4510     *
4511     *  @since Release 20101201
4512     *
4513     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4514     */
4515     public static double jauEe06a(double date1, double date2)
4516     {
4517        double gst06a, gmst06, ee;
4518 
4519 
4520     /* Apparent and mean sidereal times. */
4521        gst06a = jauGst06a(0.0, 0.0, date1, date2);
4522        gmst06 = jauGmst06(0.0, 0.0, date1, date2);
4523 
4524     /* Equation of the equinoxes. */
4525        ee  = jauAnpm(gst06a - gmst06);
4526 
4527        return ee;
4528 
4529         }
4530  
4531     private static class TERM {
4532         final int nfa[];      /* coefficients of l,l',F,D,Om,LVe,LE,pA */
4533         final double s, c;     /* sine and cosine coefficients */
4534         public TERM(int nfa[], double s, double c) {
4535             this.nfa = nfa;
4536             this.s = s;
4537             this.c = c;
4538         }
4539        
4540      } 
4541 
4542 
4543     /**
4544     *  Equation of the equinoxes complementary terms, consistent with
4545     *  IAU 2000 resolutions.
4546     *
4547     *<p>This function is derived from the International Astronomical Union's
4548     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4549     *
4550     *<p>Status:  canonical model.
4551     *
4552     *<!-- Given: -->
4553     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4554     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4555     *
4556     * <!-- Returned (function value): -->
4557     *  @return double   complementary terms (Note 2)
4558     *
4559     * <p>Notes:
4560     * <ol>
4561     *
4562     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4563     *     convenient way between the two arguments.  For example,
4564     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4565     *     among others:
4566     *<pre>
4567     *            date1          date2
4568     *
4569     *         2450123.7           0.0       (JD method)
4570     *         2451545.0       -1421.3       (J2000 method)
4571     *         2400000.5       50123.2       (MJD method)
4572     *         2450123.5           0.2       (date &amp; time method)
4573     *</pre>
4574     *     The JD method is the most natural and convenient to use in
4575     *     cases where the loss of several decimal digits of resolution
4576     *     is acceptable.  The J2000 method is best matched to the way
4577     *     the argument is handled internally and will deliver the
4578     *     optimum resolution.  The MJD method and the date &amp; time methods
4579     *     are both good compromises between resolution and convenience.
4580     *
4581     * <li> The "complementary terms" are part of the equation of the
4582     *     equinoxes (EE), classically the difference between apparent and
4583     *     mean Sidereal Time:
4584     *
4585     *        GAST = GMST + EE
4586     *
4587     *     with:
4588     *
4589     *        EE = dpsi * cos(eps)
4590     *
4591     *     where dpsi is the nutation in longitude and eps is the obliquity
4592     *     of date.  However, if the rotation of the Earth were constant in
4593     *     an inertial frame the classical formulation would lead to
4594     *     apparent irregularities in the UT1 timescale traceable to side-
4595     *     effects of precession-nutation.  In order to eliminate these
4596     *     effects from UT1, "complementary terms" were introduced in 1994
4597     *     (IAU, 1994) and took effect from 1997 (Capitaine and Gontier,
4598     * <li>:
4599     *
4600     *        GAST = GMST + CT + EE
4601     *
4602     *     By convention, the complementary terms are included as part of
4603     *     the equation of the equinoxes rather than as part of the mean
4604     *     Sidereal Time.  This slightly compromises the "geometrical"
4605     *     interpretation of mean sidereal time but is otherwise
4606     *     inconsequential.
4607     *
4608     *     The present function computes CT in the above expression,
4609     *     compatible with IAU 2000 resolutions (Capitaine et al., 2002, and
4610     *     IERS Conventions 2003).
4611     *</ol>
4612     *<p>Called:<ul>
4613     *     <li>{@link #jauFal03} mean anomaly of the Moon
4614     *     <li>{@link #jauFalp03} mean anomaly of the Sun
4615     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
4616     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
4617     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
4618     *     <li>{@link #jauFave03} mean longitude of Venus
4619     *     <li>{@link #jauFae03} mean longitude of Earth
4620     *     <li>{@link #jauFapa03} general accumulated precession in longitude
4621     * </ul>
4622     *<p>References:
4623     *
4624     *     <p>Capitaine, N. &amp; Gontier, A.-M., Astron. Astrophys., 275,
4625     *     645-650 (1993)
4626     *
4627     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4628     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4629     *     Astrophysics, 406, 1135-1149 (2003)
4630     *
4631     *     <p>IAU Resolution C7, Recommendation 3 (1994)
4632     *
4633     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4634     *     IERS Technical Note No. 32, BKG (2004)
4635     *
4636     *@version 2009 December 17
4637     *
4638     *  @since Release 20101201
4639     *
4640     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4641     */
4642     public static double jauEect00(double date1, double date2)
4643     {
4644     /* Time since J2000.0, in Julian centuries */
4645        double t;
4646 
4647     /* Miscellaneous */
4648        int i, j;
4649        double a, s0, s1;
4650 
4651     /* Fundamental arguments */
4652        double fa[] = new double[14];
4653 
4654     /* Returned value. */
4655        double eect;
4656 
4657     /* ----------------------------------------- */
4658     /* The series for the EE complementary terms */
4659     /* ----------------------------------------- */
4660 
4661 
4662     /* Terms of order t^0 */
4663        final TERM e0[] = {
4664 
4665        /* 1-10 */
4666           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, 2640.96e-6, -0.39e-6 ),
4667           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   63.52e-6, -0.02e-6 ),
4668           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   11.75e-6,  0.01e-6 ),
4669           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   11.21e-6,  0.01e-6 ),
4670           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},   -4.55e-6,  0.00e-6 ),
4671           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    2.02e-6,  0.00e-6 ),
4672           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    1.98e-6,  0.00e-6 ),
4673           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},   -1.72e-6,  0.00e-6 ),
4674           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},   -1.41e-6, -0.01e-6 ),
4675           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},   -1.26e-6, -0.01e-6 ),
4676 
4677        /* 11-20 */
4678           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4679           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4680           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    0.46e-6,  0.00e-6 ),
4681           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    0.45e-6,  0.00e-6 ),
4682           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    0.36e-6,  0.00e-6 ),
4683           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},   -0.24e-6, -0.12e-6 ),
4684           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    0.32e-6,  0.00e-6 ),
4685           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    0.28e-6,  0.00e-6 ),
4686           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    0.27e-6,  0.00e-6 ),
4687           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    0.26e-6,  0.00e-6 ),
4688 
4689        /* 21-30 */
4690           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},   -0.21e-6,  0.00e-6 ),
4691           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    0.19e-6,  0.00e-6 ),
4692           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    0.18e-6,  0.00e-6 ),
4693           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},   -0.10e-6,  0.05e-6 ),
4694           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    0.15e-6,  0.00e-6 ),
4695           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4696           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4697           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4698           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4699           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    0.13e-6,  0.00e-6 ),
4700 
4701        /* 31-33 */
4702           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},   -0.11e-6,  0.00e-6 ),
4703           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    0.11e-6,  0.00e-6 ),
4704           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    0.11e-6,  0.00e-6 )
4705        };
4706 
4707     /* Terms of order t^1 */
4708        final TERM e1[] = {
4709           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.87e-6,  0.00e-6 )
4710        };
4711 
4712     /* Number of terms in the series */
4713        final int NE0 = e0.length;
4714        final int NE1 = e1.length;
4715 
4716     /*--------------------------------------------------------------------*/
4717 
4718     /* Interval between fundamental epoch J2000.0 and current date (JC). */
4719        t = ((date1 - DJ00) + date2) / DJC;
4720 
4721     /* Fundamental Arguments (from IERS Conventions 2003) */
4722 
4723     /* Mean anomaly of the Moon. */
4724        fa[0] = jauFal03(t);
4725 
4726     /* Mean anomaly of the Sun. */
4727        fa[1] = jauFalp03(t);
4728 
4729     /* Mean longitude of the Moon minus that of the ascending node. */
4730        fa[2] = jauFaf03(t);
4731 
4732     /* Mean elongation of the Moon from the Sun. */
4733        fa[3] = jauFad03(t);
4734 
4735     /* Mean longitude of the ascending node of the Moon. */
4736        fa[4] = jauFaom03(t);
4737 
4738     /* Mean longitude of Venus. */
4739        fa[5] = jauFave03(t);
4740 
4741     /* Mean longitude of Earth. */
4742        fa[6] = jauFae03(t);
4743 
4744     /* General precession in longitude. */
4745        fa[7] = jauFapa03(t);
4746 
4747     /* Evaluate the EE complementary terms. */
4748        s0 = 0.0;
4749        s1 = 0.0;
4750 
4751        for (i = NE0-1; i >= 0; i--) {
4752           a = 0.0;
4753           for (j = 0; j < 8; j++) {
4754              a += (double)(e0[i].nfa[j]) * fa[j];
4755           }
4756           s0 += e0[i].s * sin(a) + e0[i].c * cos(a);
4757        }
4758 
4759        for (i = NE1-1; i >= 0; i--) {
4760           a = 0.0;
4761           for (j = 0; j < 8; j++) {
4762              a += (double)(e1[i].nfa[j]) * fa[j];
4763           }
4764           s1 += e1[i].s * sin(a) + e1[i].c * cos(a);
4765        }
4766 
4767        eect = (s0 + s1 * t ) * DAS2R;
4768 
4769        return eect;
4770 
4771         }
4772     
4773     /**
4774      * Reference Ellipsoid of Earth.
4775      * 
4776      * The ellipsoid parameters are returned in the form of equatorial
4777     *     radius in meters (a) and flattening (f).  The latter is a number
4778     *     around 0.00335, i.e. around 1/298.
4779     *
4780      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
4781      * 
4782      * @since AIDA Stage 1
4783      */
4784     public static class ReferenceEllipsoid{
4785         /** equatorial radius (meters, Note 2) */
4786         public double a; 
4787         /** flattening (Note 2) */
4788         public double f ;
4789         public ReferenceEllipsoid(double a, double f ) {
4790             this.a = a;
4791             this.f = f;
4792         }
4793     }
4794     /**
4795     *  Earth reference ellipsoids.
4796     *
4797     *<p>This function is derived from the International Astronomical Union's
4798     *  JSOFA (Standards of Fundamental Astronomy) software collection.
4799     *
4800     *<p>Status:  canonical.
4801     *
4802     *<!-- Given: -->
4803     *     @param n        int       ellipsoid identifier (Note 1)
4804     *
4805     *<!-- Returned: -->
4806     *     @return  a        double     <u>returned</u> equatorial radius (meters, Note 2)
4807     *              f        double     <u>returned</u> flattening (Note 2)
4808     *
4809     * <!-- Returned (function value): -->
4810     *  @throws JSOFAIllegalParameter int       status:
4811     *                          0 = OK
4812     *                         -1 = illegal identifier (Note 3)
4813     *
4814     * <p>Notes:
4815     * <ol>
4816     *
4817     * <li> The identifier n is a number that specifies the choice of
4818     *     reference ellipsoid.  The following are supported:
4819     *
4820     *        n   ellipsoid
4821     *
4822     *        1    WGS84
4823     *        2    GRS80
4824     *        3    WGS72
4825     *
4826     *     The number n has no significance outside the JSOFA software.
4827     *
4828     * <li> The ellipsoid parameters are returned in the form of equatorial
4829     *     radius in meters (a) and flattening (f).  The latter is a number
4830     *     around 0.00335, i.e. around 1/298.
4831     *
4832     * <li> For the case where an unsupported n value is supplied, zero a and
4833     *     f are returned, as well as error status.
4834     *</ol>
4835     *<p>References:
4836     *
4837     *     <p>Department of Defense World Geodetic System 1984, National
4838     *     Imagery and Mapping Agency Technical Report 8350.2, Third
4839     *     Edition, p3-2.
4840     *
4841     *     <p>Moritz, H., Bull. Geodesique 66-2, 187 (1992).
4842     *
4843     *     <p>The Department of Defense World Geodetic System 1972, World
4844     *     Geodetic System Committee, May 1974.
4845     *
4846     *     <p>Explanatory Supplement to the Astronomical Almanac,
4847     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
4848     *     p220.
4849     *
4850     *@version 2010 January 18
4851     *
4852     *  @since Release 20101201
4853     *
4854     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4855     */
4856     public static  ReferenceEllipsoid jauEform ( int n ) throws JSOFAIllegalParameter
4857     {
4858       double a,f;
4859     /* Look up a and f for the specified reference ellipsoid. */
4860        switch ( n ) {
4861        case 1:
4862 
4863        /* WGS84. */
4864           a = 6378137.0;
4865           f = 1.0 / 298.257223563;
4866           break;
4867 
4868        case 2:
4869 
4870        /* GRS80. */
4871           a = 6378137.0;
4872           f = 1.0 / 298.257222101;
4873           break;
4874 
4875        case 3:
4876 
4877        /* WGS72. */
4878           a = 6378135.0;
4879           f = 1.0 / 298.26;
4880           break;
4881 
4882        default:
4883 
4884        /* Invalid identifier. */
4885           a = 0.0;
4886           f = 0.0;
4887           throw new JSOFAIllegalParameter("illegal ellipsoid identifier", -1);
4888 
4889        }
4890 
4891     /* OK status. */
4892        return new ReferenceEllipsoid(a, f);
4893 
4894     
4895     }
4896     
4897 
4898     /**
4899     *  Equation of the origins, IAU 2006 precession and IAU 2000A nutation.
4900     *
4901     *<p>This function is derived from the International Astronomical Union's
4902     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4903     *
4904     *<p>Status:  support function.
4905     *
4906     *<!-- Given: -->
4907     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4908     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4909     *
4910     * <!-- Returned (function value): -->
4911     *  @return double    equation of the origins in radians
4912     *
4913     * <p>Notes:
4914     * <ol>
4915     *
4916     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4917     *     convenient way between the two arguments.  For example,
4918     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4919     *     among others:
4920     *<pre>
4921     *            date1          date2
4922     *
4923     *         2450123.7           0.0       (JD method)
4924     *         2451545.0       -1421.3       (J2000 method)
4925     *         2400000.5       50123.2       (MJD method)
4926     *         2450123.5           0.2       (date &amp; time method)
4927     *</pre>
4928     *     The JD method is the most natural and convenient to use in
4929     *     cases where the loss of several decimal digits of resolution
4930     *     is acceptable.  The J2000 method is best matched to the way
4931     *     the argument is handled internally and will deliver the
4932     *     optimum resolution.  The MJD method and the date &amp; time methods
4933     *     are both good compromises between resolution and convenience.
4934     *
4935     * <li> The equation of the origins is the distance between the true
4936     *     equinox and the celestial intermediate origin and, equivalently,
4937     *     the difference between Earth rotation angle and Greenwich
4938     *     apparent sidereal time (ERA-GST).  It comprises the precession
4939     *     (since J2000.0) in right ascension plus the equation of the
4940     *     equinoxes (including the small correction terms).
4941     *</ol>
4942     *<p>Called:<ul>
4943     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
4944     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
4945     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
4946     *     <li>{@link #jauEors} equation of the origins, Given NPB matrix and s
4947     * </ul>
4948     *<p>References:
4949     *
4950     *     <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
4951     *
4952     *     <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
4953     *
4954     *@version 2008 May 16
4955     *
4956     *  @since Release 20101201
4957     *
4958     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4959     */
4960     public static double jauEo06a(double date1, double date2)
4961     {
4962        double r[][], s, eo;
4963 
4964 
4965     /* Classical nutation x precession x bias matrix. */
4966        r = jauPnm06a(date1, date2);
4967 
4968     /* Extract CIP coordinates. */
4969        CelestialIntermediatePole cip = jauBpn2xy(r);
4970 
4971     /* The CIO locator, s. */
4972        s = jauS06(date1, date2, cip.x, cip.y);
4973 
4974     /* Solve for the EO. */
4975        eo = jauEors(r, s);
4976 
4977        return eo;
4978 
4979         }
4980     
4981 
4982     /**
4983     *  Equation of the origins, given the classical NPB matrix and the
4984     *  quantity s.
4985     *
4986     *<p>This function is derived from the International Astronomical Union's
4987     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4988     *
4989     *<p>Status:  support function.
4990     *
4991     *<!-- Given: -->
4992     *     @param rnpb   double[3][3]   classical nutation x precession x bias matrix
4993     *     @param s      double         the quantity s (the CIO locator)
4994     *
4995     * <!-- Returned (function value): -->
4996     *  @return double        the equation of the origins in radians.
4997     *
4998     * <p>Notes:
4999     * <ol>
5000     *
5001     * <li>  The equation of the origins is the distance between the true
5002     *      equinox and the celestial intermediate origin and, equivalently,
5003     *      the difference between Earth rotation angle and Greenwich
5004     *      apparent sidereal time (ERA-GST).  It comprises the precession
5005     *      (since J2000.0) in right ascension plus the equation of the
5006     *      equinoxes (including the small correction terms).
5007     *
5008     * <li>  The algorithm is from Wallace &amp; Capitaine (2006).
5009     *</ol>
5010     * References:
5011     *
5012     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
5013     *
5014     *    <p>Wallace, P. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
5015     *
5016     *@version 2008 May 26
5017     *
5018     *  @since Release 20101201
5019     *
5020     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5021     */
5022     public static double jauEors(double rnpb[][], double s)
5023     {
5024        double x, ax, xs, ys, zs, p, q, eo;
5025 
5026 
5027     /* Evaluate Wallace &amp; Capitaine (2006) expression (16). */
5028        x = rnpb[2][0];
5029        ax = x / (1.0 + rnpb[2][2]);
5030        xs = 1.0 - ax * x;
5031        ys = -ax * rnpb[2][1];
5032        zs = -x;
5033        p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs;
5034        q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs;
5035        eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s;
5036 
5037        return eo;
5038 
5039         }
5040     
5041 
5042     /**
5043     *  Julian Date to Besselian Epoch.
5044     *
5045     *<p>This function is derived from the International Astronomical Union's
5046     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5047     *
5048     *<p>Status:  support function.
5049     *
5050     *<!-- Given: -->
5051     *     @param dj1 double      Julian Date (see note)
5052     *     @param dj2 double      Julian Date (see note) 
5053     *
5054     * <!-- Returned (function value): -->
5055     *  @return double     Besselian Epoch.
5056     *
5057     *  Note:
5058     *
5059     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5060     *     manner, which is designed to preserve time resolution.  The
5061     *     Julian Date is available as a single number by adding dj1 and
5062     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5063     *     (J2000.0).
5064     *
5065     *<p>Reference:
5066     *
5067     *     Lieske,J.H., 1979. Astron.Astrophys.,73,282.
5068     *
5069     *@version 2009 December 16
5070     *
5071     *  @since Release 20101201
5072     *
5073     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5074     */
5075     public static double jauEpb(double dj1, double dj2)
5076     {
5077     /* J2000.0 minus B1900.0 (2415019.81352) in Julian days */
5078        final double D1900 = 36524.68648;
5079 
5080        return 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
5081 
5082         }
5083     
5084     /**
5085     *  Besselian Epoch to Julian Date.
5086     *
5087     *<p>This function is derived from the International Astronomical Union's
5088     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5089     *
5090     *<p>Status:  support function.
5091     *
5092     *<!-- Given: -->
5093     *     @param epb       double     Besselian Epoch (e.g. 1957.3D0)
5094     *
5095     *<!-- Returned: -->
5096     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5097     *
5098     *  Note:
5099     *
5100     *     The Julian Date is returned in two pieces, in the usual JSOFA
5101     *     manner, which is designed to preserve time resolution.  The
5102     *     Julian Date is available as a single number by adding djm0 and
5103     *     djm.
5104     *
5105     *<p>Reference:
5106     *
5107     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5108     *
5109     *@version 2008 May 24
5110     *
5111     *  @since Release 20101201
5112     *
5113     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5114     */
5115     public static JulianDate jauEpb2jd(double epb)
5116     {
5117         double djm0, djm;
5118        djm0 = 2400000.5;
5119        djm  =   15019.81352 + (epb - 1900.0) * DTY;
5120 
5121        return new JulianDate(djm0, djm);
5122 
5123         }
5124     
5125 
5126     /**
5127     *  Julian Date to Julian Epoch.
5128     *
5129     *<p>This function is derived from the International Astronomical Union's
5130     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5131     *
5132     *<p>Status:  support function.
5133     *
5134     *<!-- Given: -->
5135     *     @param dj1 double      Julian Date (see note)
5136     *     @param dj2 double      Julian Date (see note) 
5137     *
5138     * <!-- Returned (function value): -->
5139     *  @return double     Julian Epoch
5140     *
5141     *  Note:
5142     *
5143     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5144     *     manner, which is designed to preserve time resolution.  The
5145     *     Julian Date is available as a single number by adding dj1 and
5146     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5147     *     (J2000.0).
5148     *
5149     *<p>Reference:
5150     *
5151     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5152     *
5153     *@version 2009 December 16
5154     *
5155     *  @since Release 20101201
5156     *
5157     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5158     */
5159     public static double jauEpj(double dj1, double dj2)
5160     {
5161        return 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
5162 
5163      }
5164     
5165 
5166     /**
5167     *  Julian Epoch to Julian Date.
5168     *
5169     *<p>This function is derived from the International Astronomical Union's
5170     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5171     *
5172     *<p>Status:  support function.
5173     *
5174     *<!-- Given: -->
5175     *     @param epj       double     Julian Epoch (e.g. 1996.8D0)
5176     *
5177     *<!-- Returned: -->
5178     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5179     *
5180     *  Note:
5181     *
5182     *     The Julian Date is returned in two pieces, in the usual JSOFA
5183     *     manner, which is designed to preserve time resolution.  The
5184     *     Julian Date is available as a single number by adding djm0 and
5185     *     djm.
5186     *
5187     *<p>Reference:
5188     *
5189     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5190     *
5191     *@version 2008 May 11
5192     *
5193     *  @since Release 20101201
5194     *
5195     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5196     */
5197     public static JulianDate jauEpj2jd(double epj)
5198     {
5199        double djm0, djm;
5200        djm0 = 2400000.5;
5201        djm  =   51544.5 + (epj - 2000.0) * 365.25;
5202 
5203        return new JulianDate(djm0, djm);
5204 
5205         }
5206     
5207 
5208     /*
5209      * A utility class to get round 65536 byte limit on functions in java - The static initializer is too large on its own. - So split into two classes for no real semantic reason
5210      */        
5211     static private final class Ephemeris extends SSB {
5212        
5213 
5214     /**
5215     * ----------------------
5216     * Ephemeris Coefficients
5217     * ----------------------
5218     *
5219     * The ephemeris consists of harmonic terms for predicting (i) the Sun
5220     * to Earth vector and (ii) the Solar-System-barycenter to Sun vector
5221     * respectively.  The coefficients are stored in arrays which, although
5222     * 1-demensional, contain groups of three.  Each triplet of
5223     * coefficients is the amplitude, phase and frequency for one term in
5224     * the model, and each array contains the number of terms called for by
5225     * the model.
5226     *
5227     * There are eighteen such arrays, named as follows:
5228     *<pre>
5229     *     array         model      power of T      component
5230     *
5231     *      e0x      Sun-to-Earth        0              x
5232     *      e0y      Sun-to-Earth        0              y
5233     *      e0z      Sun-to-Earth        0              z
5234     *
5235     *      e1x      Sun-to-Earth        1              x
5236     *      e1y      Sun-to-Earth        1              y
5237     *      e1z      Sun-to-Earth        1              z
5238     *
5239     *      e2x      Sun-to-Earth        2              x
5240     *      e2y      Sun-to-Earth        2              y
5241     *      e2z      Sun-to-Earth        2              z
5242     *
5243     *      s0x      SSB-to-Sun          0              x
5244     *      s0y      SSB-to-Sun          0              y
5245     *      s0z      SSB-to-Sun          0              z
5246     *
5247     *      s1x      SSB-to-Sun          1              x
5248     *      s1y      SSB-to-Sun          1              y
5249     *      s1z      SSB-to-Sun          1              z
5250     *
5251     *      s2x      SSB-to-Sun          2              x
5252     *      s2y      SSB-to-Sun          2              y
5253     *      s2z      SSB-to-Sun          2              z
5254     *<pre>
5255     */
5256 
5257     /* Sun-to-Earth, T^0, X */
5258       static final double e0x[] = {
5259           0.9998292878132e+00, 0.1753485171504e+01, 0.6283075850446e+01,
5260           0.8352579567414e-02, 0.1710344404582e+01, 0.1256615170089e+02,
5261           0.5611445335148e-02, 0.0000000000000e+00, 0.0000000000000e+00,
5262           0.1046664295572e-03, 0.1667225416770e+01, 0.1884922755134e+02,
5263           0.3110842534677e-04, 0.6687513390251e+00, 0.8399684731857e+02,
5264           0.2552413503550e-04, 0.5830637358413e+00, 0.5296909721118e+00,
5265           0.2137207845781e-04, 0.1092330954011e+01, 0.1577343543434e+01,
5266           0.1680240182951e-04, 0.4955366134987e+00, 0.6279552690824e+01,
5267           0.1679012370795e-04, 0.6153014091901e+01, 0.6286599010068e+01,
5268           0.1445526946777e-04, 0.3472744100492e+01, 0.2352866153506e+01,
5269 
5270           0.1091038246184e-04, 0.3689845786119e+01, 0.5223693906222e+01,
5271           0.9344399733932e-05, 0.6073934645672e+01, 0.1203646072878e+02,
5272           0.8993182910652e-05, 0.3175705249069e+01, 0.1021328554739e+02,
5273           0.5665546034116e-05, 0.2152484672246e+01, 0.1059381944224e+01,
5274           0.6844146703035e-05, 0.1306964099750e+01, 0.5753384878334e+01,
5275           0.7346610905565e-05, 0.4354980070466e+01, 0.3981490189893e+00,
5276           0.6815396474414e-05, 0.2218229211267e+01, 0.4705732307012e+01,
5277           0.6112787253053e-05, 0.5384788425458e+01, 0.6812766822558e+01,
5278           0.4518120711239e-05, 0.6087604012291e+01, 0.5884926831456e+01,
5279           0.4521963430706e-05, 0.1279424524906e+01, 0.6256777527156e+01,
5280 
5281           0.4497426764085e-05, 0.5369129144266e+01, 0.6309374173736e+01,
5282           0.4062190566959e-05, 0.5436473303367e+00, 0.6681224869435e+01,
5283           0.5412193480192e-05, 0.7867838528395e+00, 0.7755226100720e+00,
5284           0.5469839049386e-05, 0.1461440311134e+01, 0.1414349524433e+02,
5285           0.5205264083477e-05, 0.4432944696116e+01, 0.7860419393880e+01,
5286           0.2149759935455e-05, 0.4502237496846e+01, 0.1150676975667e+02,
5287           0.2279109618501e-05, 0.1239441308815e+01, 0.7058598460518e+01,
5288           0.2259282939683e-05, 0.3272430985331e+01, 0.4694002934110e+01,
5289           0.2558950271319e-05, 0.2265471086404e+01, 0.1216800268190e+02,
5290           0.2561581447555e-05, 0.1454740653245e+01, 0.7099330490126e+00,
5291 
5292           0.1781441115440e-05, 0.2962068630206e+01, 0.7962980379786e+00,
5293           0.1612005874644e-05, 0.1473255041006e+01, 0.5486777812467e+01,
5294           0.1818630667105e-05, 0.3743903293447e+00, 0.6283008715021e+01,
5295           0.1818601377529e-05, 0.6274174354554e+01, 0.6283142985870e+01,
5296           0.1554475925257e-05, 0.1624110906816e+01, 0.2513230340178e+02,
5297           0.2090948029241e-05, 0.5852052276256e+01, 0.1179062909082e+02,
5298           0.2000176345460e-05, 0.4072093298513e+01, 0.1778984560711e+02,
5299           0.1289535917759e-05, 0.5217019331069e+01, 0.7079373888424e+01,
5300           0.1281135307881e-05, 0.4802054538934e+01, 0.3738761453707e+01,
5301           0.1518229005692e-05, 0.8691914742502e+00, 0.2132990797783e+00,
5302 
5303           0.9450128579027e-06, 0.4601859529950e+01, 0.1097707878456e+02,
5304           0.7781119494996e-06, 0.1844352816694e+01, 0.8827390247185e+01,
5305           0.7733407759912e-06, 0.3582790154750e+01, 0.5507553240374e+01,
5306           0.7350644318120e-06, 0.2695277788230e+01, 0.1589072916335e+01,
5307           0.6535928827023e-06, 0.3651327986142e+01, 0.1176985366291e+02,
5308           0.6324624183656e-06, 0.2241302375862e+01, 0.6262300422539e+01,
5309           0.6298565300557e-06, 0.4407122406081e+01, 0.6303851278352e+01,
5310           0.8587037089179e-06, 0.3024307223119e+01, 0.1672837615881e+03,
5311           0.8299954491035e-06, 0.6192539428237e+01, 0.3340612434717e+01,
5312           0.6311263503401e-06, 0.2014758795416e+01, 0.7113454667900e-02,
5313 
5314           0.6005646745452e-06, 0.3399500503397e+01, 0.4136910472696e+01,
5315           0.7917715109929e-06, 0.2493386877837e+01, 0.6069776770667e+01,
5316           0.7556958099685e-06, 0.4159491740143e+01, 0.6496374930224e+01,
5317           0.6773228244949e-06, 0.4034162934230e+01, 0.9437762937313e+01,
5318           0.5370708577847e-06, 0.1562219163734e+01, 0.1194447056968e+01,
5319           0.5710804266203e-06, 0.2662730803386e+01, 0.6282095334605e+01,
5320           0.5709824583726e-06, 0.3985828430833e+01, 0.6284056366286e+01,
5321           0.5143950896447e-06, 0.1308144688689e+01, 0.6290189305114e+01,
5322           0.5088010604546e-06, 0.5352817214804e+01, 0.6275962395778e+01,
5323           0.4960369085172e-06, 0.2644267922349e+01, 0.6127655567643e+01,
5324 
5325           0.4803137891183e-06, 0.4008844192080e+01, 0.6438496133249e+01,
5326           0.5731747768225e-06, 0.3794550174597e+01, 0.3154687086868e+01,
5327           0.4735947960579e-06, 0.6107118308982e+01, 0.3128388763578e+01,
5328           0.4808348796625e-06, 0.4771458618163e+01, 0.8018209333619e+00,
5329           0.4115073743137e-06, 0.3327111335159e+01, 0.8429241228195e+01,
5330           0.5230575889287e-06, 0.5305708551694e+01, 0.1336797263425e+02,
5331           0.5133977889215e-06, 0.5784230738814e+01, 0.1235285262111e+02,
5332           0.5065815825327e-06, 0.2052064793679e+01, 0.1185621865188e+02,
5333           0.4339831593868e-06, 0.3644994195830e+01, 0.1726015463500e+02,
5334           0.3952928638953e-06, 0.4930376436758e+01, 0.5481254917084e+01,
5335 
5336           0.4898498111942e-06, 0.4542084219731e+00, 0.9225539266174e+01,
5337           0.4757490209328e-06, 0.3161126388878e+01, 0.5856477690889e+01,
5338           0.4727701669749e-06, 0.6214993845446e+00, 0.2544314396739e+01,
5339           0.3800966681863e-06, 0.3040132339297e+01, 0.4265981595566e+00,
5340           0.3257301077939e-06, 0.8064977360087e+00, 0.3930209696940e+01,
5341           0.3255810528674e-06, 0.1974147981034e+01, 0.2146165377750e+01,
5342           0.3252029748187e-06, 0.2845924913135e+01, 0.4164311961999e+01,
5343           0.3255505635308e-06, 0.3017900824120e+01, 0.5088628793478e+01,
5344           0.2801345211990e-06, 0.6109717793179e+01, 0.1256967486051e+02,
5345           0.3688987740970e-06, 0.2911550235289e+01, 0.1807370494127e+02,
5346 
5347           0.2475153429458e-06, 0.2179146025856e+01, 0.2629832328990e-01,
5348           0.3033457749150e-06, 0.1994161050744e+01, 0.4535059491685e+01,
5349           0.2186743763110e-06, 0.5125687237936e+01, 0.1137170464392e+02,
5350           0.2764777032774e-06, 0.4822646860252e+00, 0.1256262854127e+02,
5351           0.2199028768592e-06, 0.4637633293831e+01, 0.1255903824622e+02,
5352           0.2046482824760e-06, 0.1467038733093e+01, 0.7084896783808e+01,
5353           0.2611209147507e-06, 0.3044718783485e+00, 0.7143069561767e+02,
5354           0.2286079656818e-06, 0.4764220356805e+01, 0.8031092209206e+01,
5355           0.1855071202587e-06, 0.3383637774428e+01, 0.1748016358760e+01,
5356           0.2324669506784e-06, 0.6189088449251e+01, 0.1831953657923e+02,
5357 
5358           0.1709528015688e-06, 0.5874966729774e+00, 0.4933208510675e+01,
5359           0.2168156875828e-06, 0.4302994009132e+01, 0.1044738781244e+02,
5360           0.2106675556535e-06, 0.3800475419891e+01, 0.7477522907414e+01,
5361           0.1430213830465e-06, 0.1294660846502e+01, 0.2942463415728e+01,
5362           0.1388396901944e-06, 0.4594797202114e+01, 0.8635942003952e+01,
5363           0.1922258844190e-06, 0.4943044543591e+00, 0.1729818233119e+02,
5364           0.1888460058292e-06, 0.2426943912028e+01, 0.1561374759853e+03,
5365           0.1789449386107e-06, 0.1582973303499e+00, 0.1592596075957e+01,
5366           0.1360803685374e-06, 0.5197240440504e+01, 0.1309584267300e+02,
5367           0.1504038014709e-06, 0.3120360916217e+01, 0.1649636139783e+02,
5368 
5369           0.1382769533389e-06, 0.6164702888205e+01, 0.7632943190217e+01,
5370           0.1438059769079e-06, 0.1437423770979e+01, 0.2042657109477e+02,
5371           0.1326303260037e-06, 0.3609688799679e+01, 0.1213955354133e+02,
5372           0.1159244950540e-06, 0.5463018167225e+01, 0.5331357529664e+01,
5373           0.1433118149136e-06, 0.6028909912097e+01, 0.7342457794669e+01,
5374           0.1234623148594e-06, 0.3109645574997e+01, 0.6279485555400e+01,
5375           0.1233949875344e-06, 0.3539359332866e+01, 0.6286666145492e+01,
5376           0.9927196061299e-07, 0.1259321569772e+01, 0.7234794171227e+01,
5377           0.1242302191316e-06, 0.1065949392609e+01, 0.1511046609763e+02,
5378           0.1098402195201e-06, 0.2192508743837e+01, 0.1098880815746e+02,
5379 
5380           0.1158191395315e-06, 0.4054411278650e+01, 0.5729506548653e+01,
5381           0.9048475596241e-07, 0.5429764748518e+01, 0.9623688285163e+01,
5382           0.8889853269023e-07, 0.5046586206575e+01, 0.6148010737701e+01,
5383           0.1048694242164e-06, 0.2628858030806e+01, 0.6836645152238e+01,
5384           0.1112308378646e-06, 0.4177292719907e+01, 0.1572083878776e+02,
5385           0.8631729709901e-07, 0.1601345232557e+01, 0.6418140963190e+01,
5386           0.8527816951664e-07, 0.2463888997513e+01, 0.1471231707864e+02,
5387           0.7892139456991e-07, 0.3154022088718e+01, 0.2118763888447e+01,
5388           0.1051782905236e-06, 0.4795035816088e+01, 0.1349867339771e+01,
5389           0.1048219943164e-06, 0.2952983395230e+01, 0.5999216516294e+01,
5390 
5391           0.7435760775143e-07, 0.5420547991464e+01, 0.6040347114260e+01,
5392           0.9869574106949e-07, 0.3695646753667e+01, 0.6566935184597e+01,
5393           0.9156886364226e-07, 0.3922675306609e+01, 0.5643178611111e+01,
5394           0.7006834356188e-07, 0.1233968624861e+01, 0.6525804586632e+01,
5395           0.9806170182601e-07, 0.1919542280684e+01, 0.2122839202813e+02,
5396           0.9052289673607e-07, 0.4615902724369e+01, 0.4690479774488e+01,
5397           0.7554200867893e-07, 0.1236863719072e+01, 0.1253985337760e+02,
5398           0.8215741286498e-07, 0.3286800101559e+00, 0.1097355562493e+02,
5399           0.7185178575397e-07, 0.5880942158367e+01, 0.6245048154254e+01,
5400           0.7130726476180e-07, 0.7674871987661e+00, 0.6321103546637e+01,
5401 
5402           0.6650894461162e-07, 0.6987129150116e+00, 0.5327476111629e+01,
5403           0.7396888823688e-07, 0.3576824794443e+01, 0.5368044267797e+00,
5404           0.7420588884775e-07, 0.5033615245369e+01, 0.2354323048545e+02,
5405           0.6141181642908e-07, 0.9449927045673e+00, 0.1296430071988e+02,
5406           0.6373557924058e-07, 0.6206342280341e+01, 0.9517183207817e+00,
5407           0.6359474329261e-07, 0.5036079095757e+01, 0.1990745094947e+01,
5408           0.5740173582646e-07, 0.6105106371350e+01, 0.9555997388169e+00,
5409           0.7019864084602e-07, 0.7237747359018e+00, 0.5225775174439e+00,
5410           0.6398054487042e-07, 0.3976367969666e+01, 0.2407292145756e+02,
5411           0.7797092650498e-07, 0.4305423910623e+01, 0.2200391463820e+02,
5412 
5413           0.6466760000900e-07, 0.3500136825200e+01, 0.5230807360890e+01,
5414           0.7529417043890e-07, 0.3514779246100e+01, 0.1842262939178e+02,
5415           0.6924571140892e-07, 0.2743457928679e+01, 0.1554202828031e+00,
5416           0.6220798650222e-07, 0.2242598118209e+01, 0.1845107853235e+02,
5417           0.5870209391853e-07, 0.2332832707527e+01, 0.6398972393349e+00,
5418           0.6263953473888e-07, 0.2191105358956e+01, 0.6277552955062e+01,
5419           0.6257781390012e-07, 0.4457559396698e+01, 0.6288598745829e+01,
5420           0.5697304945123e-07, 0.3499234761404e+01, 0.1551045220144e+01,
5421           0.6335438746791e-07, 0.6441691079251e+00, 0.5216580451554e+01,
5422           0.6377258441152e-07, 0.2252599151092e+01, 0.5650292065779e+01,
5423 
5424           0.6484841818165e-07, 0.1992812417646e+01, 0.1030928125552e+00,
5425           0.4735551485250e-07, 0.3744672082942e+01, 0.1431416805965e+02,
5426           0.4628595996170e-07, 0.1334226211745e+01, 0.5535693017924e+00,
5427           0.6258152336933e-07, 0.4395836159154e+01, 0.2608790314060e+02,
5428           0.6196171366594e-07, 0.2587043007997e+01, 0.8467247584405e+02,
5429           0.6159556952126e-07, 0.4782499769128e+01, 0.2394243902548e+03,
5430           0.4987741172394e-07, 0.7312257619924e+00, 0.7771377146812e+02,
5431           0.5459280703142e-07, 0.3001376372532e+01, 0.6179983037890e+01,
5432           0.4863461189999e-07, 0.3767222128541e+01, 0.9027992316901e+02,
5433           0.5349912093158e-07, 0.3663594450273e+01, 0.6386168663001e+01,
5434 
5435           0.5673725607806e-07, 0.4331187919049e+01, 0.6915859635113e+01,
5436           0.4745485060512e-07, 0.5816195745518e+01, 0.6282970628506e+01,
5437           0.4745379005326e-07, 0.8323672435672e+00, 0.6283181072386e+01,
5438           0.4049002796321e-07, 0.3785023976293e+01, 0.6254626709878e+01,
5439           0.4247084014515e-07, 0.2378220728783e+01, 0.7875671926403e+01,
5440           0.4026912363055e-07, 0.2864103423269e+01, 0.6311524991013e+01,
5441           0.4062935011774e-07, 0.2415408595975e+01, 0.3634620989887e+01,
5442           0.5347771048509e-07, 0.3343479309801e+01, 0.2515860172507e+02,
5443           0.4829494136505e-07, 0.2821742398262e+01, 0.5760498333002e+01,
5444           0.4342554404599e-07, 0.5624662458712e+01, 0.7238675589263e+01,
5445 
5446           0.4021599184361e-07, 0.5557250275009e+00, 0.1101510648075e+02,
5447           0.4104900474558e-07, 0.3296691780005e+01, 0.6709674010002e+01,
5448           0.4376532905131e-07, 0.3814443999443e+01, 0.6805653367890e+01,
5449           0.3314590480650e-07, 0.3560229189250e+01, 0.1259245002418e+02,
5450           0.3232421839643e-07, 0.5185389180568e+01, 0.1066495398892e+01,
5451           0.3541176318876e-07, 0.3921381909679e+01, 0.9917696840332e+01,
5452           0.3689831242681e-07, 0.4190658955386e+01, 0.1192625446156e+02,
5453           0.3890605376774e-07, 0.5546023371097e+01, 0.7478166569050e-01,
5454           0.3038559339780e-07, 0.6231032794494e+01, 0.1256621883632e+02,
5455           0.3137083969782e-07, 0.6207063419190e+01, 0.4292330755499e+01,
5456 
5457           0.4024004081854e-07, 0.1195257375713e+01, 0.1334167431096e+02,
5458           0.3300234879283e-07, 0.1804694240998e+01, 0.1057540660594e+02,
5459           0.3635399155575e-07, 0.5597811343500e+01, 0.6208294184755e+01,
5460           0.3032668691356e-07, 0.3191059366530e+01, 0.1805292951336e+02,
5461           0.2809652069058e-07, 0.4094348032570e+01, 0.3523159621801e-02,
5462           0.3696955383823e-07, 0.5219282738794e+01, 0.5966683958112e+01,
5463           0.3562894142503e-07, 0.1037247544554e+01, 0.6357857516136e+01,
5464           0.3510598524148e-07, 0.1430020816116e+01, 0.6599467742779e+01,
5465           0.3617736142953e-07, 0.3002911403677e+01, 0.6019991944201e+01,
5466           0.2624524910730e-07, 0.2437046757292e+01, 0.6702560555334e+01,
5467 
5468           0.2535824204490e-07, 0.1581594689647e+01, 0.3141537925223e+02,
5469           0.3519787226257e-07, 0.5379863121521e+01, 0.2505706758577e+03,
5470           0.2578406709982e-07, 0.4904222639329e+01, 0.1673046366289e+02,
5471           0.3423887981473e-07, 0.3646448997315e+01, 0.6546159756691e+01,
5472           0.2776083886467e-07, 0.3307829300144e+01, 0.1272157198369e+02,
5473           0.3379592818379e-07, 0.1747541251125e+01, 0.1494531617769e+02,
5474           0.3050255426284e-07, 0.1784689432607e-01, 0.4732030630302e+01,
5475           0.2652378350236e-07, 0.4420055276260e+01, 0.5863591145557e+01,
5476           0.2374498173768e-07, 0.3629773929208e+01, 0.2388894113936e+01,
5477           0.2716451255140e-07, 0.3079623706780e+01, 0.1202934727411e+02,
5478 
5479           0.3038583699229e-07, 0.3312487903507e+00, 0.1256608456547e+02,
5480           0.2220681228760e-07, 0.5265520401774e+01, 0.1336244973887e+02,
5481           0.3044156540912e-07, 0.4766664081250e+01, 0.2908881142201e+02,
5482           0.2731859923561e-07, 0.5069146530691e+01, 0.1391601904066e+02,
5483           0.2285603018171e-07, 0.5954935112271e+01, 0.6076890225335e+01,
5484           0.2025006454555e-07, 0.4061789589267e+01, 0.4701116388778e+01,
5485           0.2012597519804e-07, 0.2485047705241e+01, 0.6262720680387e+01,
5486           0.2003406962258e-07, 0.4163779209320e+01, 0.6303431020504e+01,
5487           0.2207863441371e-07, 0.6923839133828e+00, 0.6489261475556e+01,
5488           0.2481374305624e-07, 0.5944173595676e+01, 0.1204357418345e+02,
5489 
5490           0.2130923288870e-07, 0.4641013671967e+01, 0.5746271423666e+01,
5491           0.2446370543391e-07, 0.6125796518757e+01, 0.1495633313810e+00,
5492           0.1932492759052e-07, 0.2234572324504e+00, 0.1352175143971e+02,
5493           0.2600122568049e-07, 0.4281012405440e+01, 0.4590910121555e+01,
5494           0.2431754047488e-07, 0.1429943874870e+00, 0.1162474756779e+01,
5495           0.1875902869209e-07, 0.9781803816948e+00, 0.6279194432410e+01,
5496           0.1874381139426e-07, 0.5670368130173e+01, 0.6286957268481e+01,
5497           0.2156696047173e-07, 0.2008985006833e+01, 0.1813929450232e+02,
5498           0.1965076182484e-07, 0.2566186202453e+00, 0.4686889479442e+01,
5499           0.2334816372359e-07, 0.4408121891493e+01, 0.1002183730415e+02,
5500 
5501           0.1869937408802e-07, 0.5272745038656e+01, 0.2427287361862e+00,
5502           0.2436236460883e-07, 0.4407720479029e+01, 0.9514313292143e+02,
5503           0.1761365216611e-07, 0.1943892315074e+00, 0.1351787002167e+02,
5504           0.2156289480503e-07, 0.1418570924545e+01, 0.6037244212485e+01,
5505           0.2164748979255e-07, 0.4724603439430e+01, 0.2301353951334e+02,
5506           0.2222286670853e-07, 0.2400266874598e+01, 0.1266924451345e+02,
5507           0.2070901414929e-07, 0.5230348028732e+01, 0.6528907488406e+01,
5508           0.1792745177020e-07, 0.2099190328945e+01, 0.6819880277225e+01,
5509           0.1841802068445e-07, 0.3467527844848e+00, 0.6514761976723e+02,
5510           0.1578401631718e-07, 0.7098642356340e+00, 0.2077542790660e-01,
5511 
5512           0.1561690152531e-07, 0.5943349620372e+01, 0.6272439236156e+01,
5513           0.1558591045463e-07, 0.7040653478980e+00, 0.6293712464735e+01,
5514           0.1737356469576e-07, 0.4487064760345e+01, 0.1765478049437e+02,
5515           0.1434755619991e-07, 0.2993391570995e+01, 0.1102062672231e+00,
5516           0.1482187806654e-07, 0.2278049198251e+01, 0.1052268489556e+01,
5517           0.1424812827089e-07, 0.1682114725827e+01, 0.1311972100268e+02,
5518           0.1380282448623e-07, 0.3262668602579e+01, 0.1017725758696e+02,
5519           0.1811481244566e-07, 0.3187771221777e+01, 0.1887552587463e+02,
5520           0.1504446185696e-07, 0.5650162308647e+01, 0.7626583626240e-01,
5521           0.1740776154137e-07, 0.5487068607507e+01, 0.1965104848470e+02,
5522 
5523           0.1374339536251e-07, 0.5745688172201e+01, 0.6016468784579e+01,
5524           0.1761377477704e-07, 0.5748060203659e+01, 0.2593412433514e+02,
5525           0.1535138225795e-07, 0.6226848505790e+01, 0.9411464614024e+01,
5526           0.1788140543676e-07, 0.6189318878563e+01, 0.3301902111895e+02,
5527           0.1375002807996e-07, 0.5371812884394e+01, 0.6327837846670e+00,
5528           0.1242115758632e-07, 0.1471687569712e+01, 0.3894181736510e+01,
5529           0.1450977333938e-07, 0.4143836662127e+01, 0.1277945078067e+02,
5530           0.1297579575023e-07, 0.9003477661957e+00, 0.6549682916313e+01,
5531           0.1462667934821e-07, 0.5760505536428e+01, 0.1863592847156e+02,
5532           0.1381774374799e-07, 0.1085471729463e+01, 0.2379164476796e+01,
5533 
5534           0.1682333169307e-07, 0.5409870870133e+01, 0.1620077269078e+02,
5535           0.1190812918837e-07, 0.1397205174601e+01, 0.1149965630200e+02,
5536           0.1221434762106e-07, 0.9001804809095e+00, 0.1257326515556e+02,
5537           0.1549934644860e-07, 0.4262528275544e+01, 0.1820933031200e+02,
5538           0.1252138953050e-07, 0.1411642012027e+01, 0.6993008899458e+01,
5539           0.1237078905387e-07, 0.2844472403615e+01, 0.2435678079171e+02,
5540           0.1446953389615e-07, 0.5295835522223e+01, 0.3813291813120e-01,
5541           0.1388446457170e-07, 0.4969428135497e+01, 0.2458316379602e+00,
5542           0.1019339179228e-07, 0.2491369561806e+01, 0.6112403035119e+01,
5543           0.1258880815343e-07, 0.4679426248976e+01, 0.5429879531333e+01,
5544 
5545           0.1297768238261e-07, 0.1074509953328e+01, 0.1249137003520e+02,
5546           0.9913505718094e-08, 0.4735097918224e+01, 0.6247047890016e+01,
5547           0.9830453155969e-08, 0.4158649187338e+01, 0.6453748665772e+01,
5548           0.1192615865309e-07, 0.3438208613699e+01, 0.6290122169689e+01,
5549           0.9835874798277e-08, 0.1913300781229e+01, 0.6319103810876e+01,
5550           0.9639087569277e-08, 0.9487683644125e+00, 0.8273820945392e+01,
5551           0.1175716107001e-07, 0.3228141664287e+01, 0.6276029531202e+01,
5552           0.1018926508678e-07, 0.2216607854300e+01, 0.1254537627298e+02,
5553           0.9500087869225e-08, 0.2625116459733e+01, 0.1256517118505e+02,
5554           0.9664192916575e-08, 0.5860562449214e+01, 0.6259197520765e+01,
5555 
5556           0.9612858712203e-08, 0.7885682917381e+00, 0.6306954180126e+01,
5557           0.1117645675413e-07, 0.3932148831189e+01, 0.1779695906178e+02,
5558           0.1158864052160e-07, 0.9995605521691e+00, 0.1778273215245e+02,
5559           0.9021043467028e-08, 0.5263769742673e+01, 0.6172869583223e+01,
5560           0.8836134773563e-08, 0.1496843220365e+01, 0.1692165728891e+01,
5561           0.1045872200691e-07, 0.7009039517214e+00, 0.2204125344462e+00,
5562           0.1211463487798e-07, 0.4041544938511e+01, 0.8257698122054e+02,
5563           0.8541990804094e-08, 0.1447586692316e+01, 0.6393282117669e+01,
5564           0.1038720703636e-07, 0.4594249718112e+00, 0.1550861511662e+02,
5565           0.1126722351445e-07, 0.3925550579036e+01, 0.2061856251104e+00,
5566 
5567           0.8697373859631e-08, 0.4411341856037e+01, 0.9491756770005e+00,
5568           0.8869380028441e-08, 0.2402659724813e+01, 0.3903911373650e+01,
5569           0.9247014693258e-08, 0.1401579743423e+01, 0.6267823317922e+01,
5570           0.9205062930950e-08, 0.5245978000814e+01, 0.6298328382969e+01,
5571           0.8000745038049e-08, 0.3590803356945e+01, 0.2648454860559e+01,
5572           0.9168973650819e-08, 0.2470150501679e+01, 0.1498544001348e+03,
5573           0.1075444949238e-07, 0.1328606161230e+01, 0.3694923081589e+02,
5574           0.7817298525817e-08, 0.6162256225998e+01, 0.4804209201333e+01,
5575           0.9541469226356e-08, 0.3942568967039e+01, 0.1256713221673e+02,
5576           0.9821910122027e-08, 0.2360246287233e+00, 0.1140367694411e+02,
5577 
5578           0.9897822023777e-08, 0.4619805634280e+01, 0.2280573557157e+02,
5579           0.7737289283765e-08, 0.3784727847451e+01, 0.7834121070590e+01,
5580           0.9260204034710e-08, 0.2223352487601e+01, 0.2787043132925e+01,
5581           0.7320252888486e-08, 0.1288694636874e+01, 0.6282655592598e+01,
5582           0.7319785780946e-08, 0.5359869567774e+01, 0.6283496108294e+01,
5583           0.7147219933778e-08, 0.5516616675856e+01, 0.1725663147538e+02,
5584           0.7946502829878e-08, 0.2630459984567e+01, 0.1241073141809e+02,
5585           0.9001711808932e-08, 0.2849815827227e+01, 0.6281591679874e+01,
5586           0.8994041507257e-08, 0.3795244450750e+01, 0.6284560021018e+01,
5587           0.8298582787358e-08, 0.5236413127363e+00, 0.1241658836951e+02,
5588 
5589           0.8526596520710e-08, 0.4794605424426e+01, 0.1098419223922e+02,
5590           0.8209822103197e-08, 0.1578752370328e+01, 0.1096996532989e+02,
5591           0.6357049861094e-08, 0.5708926113761e+01, 0.1596186371003e+01,
5592           0.7370473179049e-08, 0.3842402530241e+01, 0.4061219149443e+01,
5593           0.7232154664726e-08, 0.3067548981535e+01, 0.1610006857377e+03,
5594           0.6328765494903e-08, 0.1313930030069e+01, 0.1193336791622e+02,
5595           0.8030064908595e-08, 0.3488500408886e+01, 0.8460828644453e+00,
5596           0.6275464259232e-08, 0.1532061626198e+01, 0.8531963191132e+00,
5597           0.7051897446325e-08, 0.3285859929993e+01, 0.5849364236221e+01,
5598           0.6161593705428e-08, 0.1477341999464e+01, 0.5573142801433e+01,
5599 
5600           0.7754683957278e-08, 0.1586118663096e+01, 0.8662240327241e+01,
5601           0.5889928990701e-08, 0.1304887868803e+01, 0.1232342296471e+02,
5602           0.5705756047075e-08, 0.4555333589350e+01, 0.1258692712880e+02,
5603           0.5964178808332e-08, 0.3001762842062e+01, 0.5333900173445e+01,
5604           0.6712446027467e-08, 0.4886780007595e+01, 0.1171295538178e+02,
5605           0.5941809275464e-08, 0.4701509603824e+01, 0.9779108567966e+01,
5606           0.5466993627395e-08, 0.4588357817278e+01, 0.1884211409667e+02,
5607           0.6340512090980e-08, 0.1164543038893e+01, 0.5217580628120e+02,
5608           0.6325505710045e-08, 0.3919171259645e+01, 0.1041998632314e+02,
5609           0.6164789509685e-08, 0.2143828253542e+01, 0.6151533897323e+01,
5610 
5611           0.5263330812430e-08, 0.6066564434241e+01, 0.1885275071096e+02,
5612           0.5597087780221e-08, 0.2926316429472e+01, 0.4337116142245e+00,
5613           0.5396556236817e-08, 0.3244303591505e+01, 0.6286362197481e+01,
5614           0.5396615148223e-08, 0.3404304703662e+01, 0.6279789503410e+01,
5615           0.7091832443341e-08, 0.8532377803192e+00, 0.4907302013889e+01,
5616           0.6572352589782e-08, 0.4901966774419e+01, 0.1176433076753e+02,
5617           0.5960236060795e-08, 0.1874672315797e+01, 0.1422690933580e-01,
5618           0.5125480043511e-08, 0.3735726064334e+01, 0.1245594543367e+02,
5619           0.5928241866410e-08, 0.4502033899935e+01, 0.6414617803568e+01,
5620           0.5249600357424e-08, 0.4372334799878e+01, 0.1151388321134e+02,
5621 
5622           0.6059171276087e-08, 0.2581617302908e+01, 0.6062663316000e+01,
5623           0.5295235081662e-08, 0.2974811513158e+01, 0.3496032717521e+01,
5624           0.5820561875933e-08, 0.1796073748244e+00, 0.2838593341516e+00,
5625           0.4754696606440e-08, 0.1981998136973e+01, 0.3104930017775e+01,
5626           0.6385053548955e-08, 0.2559174171605e+00, 0.6133512519065e+01,
5627           0.6589828273941e-08, 0.2750967106776e+01, 0.4087944051283e+02,
5628           0.5383376567189e-08, 0.6325947523578e+00, 0.2248384854122e+02,
5629           0.5928941683538e-08, 0.1672304519067e+01, 0.1581959461667e+01,
5630           0.4816060709794e-08, 0.3512566172575e+01, 0.9388005868221e+01,
5631           0.6003381586512e-08, 0.5610932219189e+01, 0.5326786718777e+01,
5632 
5633           0.5504225393105e-08, 0.4037501131256e+01, 0.6503488384892e+01,
5634           0.5353772620129e-08, 0.6122774968240e+01, 0.1735668374386e+03,
5635           0.5786253768544e-08, 0.5527984999515e+01, 0.1350651127443e+00,
5636           0.5065706702002e-08, 0.9980765573624e+00, 0.1248988586463e+02,
5637           0.5972838885276e-08, 0.6044489493203e+01, 0.2673594526851e+02,
5638           0.5323585877961e-08, 0.3924265998147e+01, 0.4171425416666e+01,
5639           0.5210772682858e-08, 0.6220111376901e+01, 0.2460261242967e+02,
5640           0.4726549040535e-08, 0.3716043206862e+01, 0.7232251527446e+01,
5641           0.6029425105059e-08, 0.8548704071116e+00, 0.3227113045244e+03,
5642           0.4481542826513e-08, 0.1426925072829e+01, 0.5547199253223e+01,
5643 
5644           0.5836024505068e-08, 0.7135651752625e-01, 0.7285056171570e+02,
5645           0.4137046613272e-08, 0.5330767643283e+01, 0.1087398597200e+02,
5646           0.5171977473924e-08, 0.4494262335353e+00, 0.1884570439172e+02,
5647           0.5694429833732e-08, 0.2952369582215e+01, 0.9723862754494e+02,
5648           0.4009158925298e-08, 0.3500003416535e+01, 0.6244942932314e+01,
5649           0.4784939596873e-08, 0.6196709413181e+01, 0.2929661536378e+02,
5650           0.3983725022610e-08, 0.5103690031897e+01, 0.4274518229222e+01,
5651           0.3870535232462e-08, 0.3187569587401e+01, 0.6321208768577e+01,
5652           0.5140501213951e-08, 0.1668924357457e+01, 0.1232032006293e+02,
5653           0.3849034819355e-08, 0.4445722510309e+01, 0.1726726808967e+02,
5654 
5655           0.4002383075060e-08, 0.5226224152423e+01, 0.7018952447668e+01,
5656           0.3890719543549e-08, 0.4371166550274e+01, 0.1491901785440e+02,
5657           0.4887084607881e-08, 0.5973556689693e+01, 0.1478866649112e+01,
5658           0.3739939287592e-08, 0.2089084714600e+01, 0.6922973089781e+01,
5659           0.5031925918209e-08, 0.4658371936827e+01, 0.1715706182245e+02,
5660           0.4387748764954e-08, 0.4825580552819e+01, 0.2331413144044e+03,
5661           0.4147398098865e-08, 0.3739003524998e+01, 0.1376059875786e+02,
5662           0.3719089993586e-08, 0.1148941386536e+01, 0.6297302759782e+01,
5663           0.3934238461056e-08, 0.1559893008343e+01, 0.7872148766781e+01,
5664           0.3672471375622e-08, 0.5516145383612e+01, 0.6268848941110e+01,
5665 
5666           0.3768911277583e-08, 0.6116053700563e+01, 0.4157198507331e+01,
5667           0.4033388417295e-08, 0.5076821746017e+01, 0.1567108171867e+02,
5668           0.3764194617832e-08, 0.8164676232075e+00, 0.3185192151914e+01,
5669           0.4840628226284e-08, 0.1360479453671e+01, 0.1252801878276e+02,
5670           0.4949443923785e-08, 0.2725622229926e+01, 0.1617106187867e+03,
5671           0.4117393089971e-08, 0.6054459628492e+00, 0.5642198095270e+01,
5672           0.3925754020428e-08, 0.8570462135210e+00, 0.2139354194808e+02,
5673           0.3630551757923e-08, 0.3552067338279e+01, 0.6294805223347e+01,
5674           0.3627274802357e-08, 0.3096565085313e+01, 0.6271346477544e+01,
5675           0.3806143885093e-08, 0.6367751709777e+00, 0.1725304118033e+02,
5676 
5677           0.4433254641565e-08, 0.4848461503937e+01, 0.7445550607224e+01,
5678           0.3712319846576e-08, 0.1331950643655e+01, 0.4194847048887e+00,
5679           0.3849847534783e-08, 0.4958368297746e+00, 0.9562891316684e+00,
5680           0.3483955430165e-08, 0.2237215515707e+01, 0.1161697602389e+02,
5681           0.3961912730982e-08, 0.3332402188575e+01, 0.2277943724828e+02,
5682           0.3419978244481e-08, 0.5785600576016e+01, 0.1362553364512e+02,
5683           0.3329417758177e-08, 0.9812676559709e-01, 0.1685848245639e+02,
5684           0.4207206893193e-08, 0.9494780468236e+00, 0.2986433403208e+02,
5685           0.3268548976410e-08, 0.1739332095686e+00, 0.5749861718712e+01,
5686           0.3321880082685e-08, 0.1423354800666e+01, 0.6279143387820e+01,
5687 
5688           0.4503173010852e-08, 0.2314972675293e+00, 0.1385561574497e+01,
5689           0.4316599090954e-08, 0.1012646782616e+00, 0.4176041334900e+01,
5690           0.3283493323850e-08, 0.5233306881265e+01, 0.6287008313071e+01,
5691           0.3164033542343e-08, 0.4005597257511e+01, 0.2099539292909e+02,
5692           0.4159720956725e-08, 0.5365676242020e+01, 0.5905702259363e+01,
5693           0.3565176892217e-08, 0.4284440620612e+01, 0.3932462625300e-02,
5694           0.3514440950221e-08, 0.4270562636575e+01, 0.7335344340001e+01,
5695           0.3540596871909e-08, 0.5953553201060e+01, 0.1234573916645e+02,
5696           0.2960769905118e-08, 0.1115180417718e+01, 0.2670964694522e+02,
5697           0.2962213739684e-08, 0.3863811918186e+01, 0.6408777551755e+00,
5698 
5699           0.3883556700251e-08, 0.1268617928302e+01, 0.6660449441528e+01,
5700           0.2919225516346e-08, 0.4908605223265e+01, 0.1375773836557e+01,
5701           0.3115158863370e-08, 0.3744519976885e+01, 0.3802769619140e-01,
5702           0.4099438144212e-08, 0.4173244670532e+01, 0.4480965020977e+02,
5703           0.2899531858964e-08, 0.5910601428850e+01, 0.2059724391010e+02,
5704           0.3289733429855e-08, 0.2488050078239e+01, 0.1081813534213e+02,
5705           0.3933075612875e-08, 0.1122363652883e+01, 0.3773735910827e+00,
5706           0.3021403764467e-08, 0.4951973724904e+01, 0.2982630633589e+02,
5707           0.2798598949757e-08, 0.5117057845513e+01, 0.1937891852345e+02,
5708           0.3397421302707e-08, 0.6104159180476e+01, 0.6923953605621e+01,
5709 
5710           0.3720398002179e-08, 0.1184933429829e+01, 0.3066615496545e+02,
5711           0.3598484186267e-08, 0.3505282086105e+01, 0.6147450479709e+01,
5712           0.3694594027310e-08, 0.2286651088141e+01, 0.2636725487657e+01,
5713           0.2680444152969e-08, 0.1871816775482e+00, 0.6816289982179e+01,
5714           0.3497574865641e-08, 0.3143251755431e+01, 0.6418701221183e+01,
5715           0.3130274129494e-08, 0.2462167316018e+01, 0.1235996607578e+02,
5716           0.3241119069551e-08, 0.4256374004686e+01, 0.1652265972112e+02,
5717           0.2601960842061e-08, 0.4970362941425e+01, 0.1045450126711e+02,
5718           0.2690601527504e-08, 0.2372657824898e+01, 0.3163918923335e+00,
5719           0.2908688152664e-08, 0.4232652627721e+01, 0.2828699048865e+02,
5720 
5721           0.3120456131875e-08, 0.3925747001137e+00, 0.2195415756911e+02,
5722           0.3148855423384e-08, 0.3093478330445e+01, 0.1172006883645e+02,
5723           0.3051044261017e-08, 0.5560948248212e+01, 0.6055599646783e+01,
5724           0.2826006876660e-08, 0.5072790310072e+01, 0.5120601093667e+01,
5725           0.3100034191711e-08, 0.4998530231096e+01, 0.1799603123222e+02,
5726           0.2398771640101e-08, 0.2561739802176e+01, 0.6255674361143e+01,
5727           0.2384002842728e-08, 0.4087420284111e+01, 0.6310477339748e+01,
5728           0.2842146517568e-08, 0.2515048217955e+01, 0.5469525544182e+01,
5729           0.2847674371340e-08, 0.5235326497443e+01, 0.1034429499989e+02,
5730           0.2903722140764e-08, 0.1088200795797e+01, 0.6510552054109e+01,
5731 
5732           0.3187610710605e-08, 0.4710624424816e+01, 0.1693792562116e+03,
5733           0.3048869992813e-08, 0.2857975896445e+00, 0.8390110365991e+01,
5734           0.2860216950984e-08, 0.2241619020815e+01, 0.2243449970715e+00,
5735           0.2701117683113e-08, 0.6651573305272e-01, 0.6129297044991e+01,
5736           0.2509891590152e-08, 0.1285135324585e+01, 0.1044027435778e+02,
5737           0.2623200252223e-08, 0.2981229834530e+00, 0.6436854655901e+01,
5738           0.2622541669202e-08, 0.6122470726189e+01, 0.9380959548977e+01,
5739           0.2818435667099e-08, 0.4251087148947e+01, 0.5934151399930e+01,
5740           0.2365196797465e-08, 0.3465070460790e+01, 0.2470570524223e+02,
5741           0.2358704646143e-08, 0.5791603815350e+01, 0.8671969964381e+01,
5742 
5743           0.2388299481390e-08, 0.4142483772941e+01, 0.7096626156709e+01,
5744           0.1996041217224e-08, 0.2101901889496e+01, 0.1727188400790e+02,
5745           0.2687593060336e-08, 0.1526689456959e+01, 0.7075506709219e+02,
5746           0.2618913670810e-08, 0.2397684236095e+01, 0.6632000300961e+01,
5747           0.2571523050364e-08, 0.5751929456787e+00, 0.6206810014183e+01,
5748           0.2582135006946e-08, 0.5595464352926e+01, 0.4873985990671e+02,
5749           0.2372530190361e-08, 0.5092689490655e+01, 0.1590676413561e+02,
5750           0.2357178484712e-08, 0.4444363527851e+01, 0.3097883698531e+01,
5751           0.2451590394723e-08, 0.3108251687661e+01, 0.6612329252343e+00,
5752           0.2370045949608e-08, 0.2608133861079e+01, 0.3459636466239e+02,
5753 
5754           0.2268997267358e-08, 0.3639717753384e+01, 0.2844914056730e-01,
5755           0.1731432137906e-08, 0.1741898445707e+00, 0.2019909489111e+02,
5756           0.1629869741622e-08, 0.3902225646724e+01, 0.3035599730800e+02,
5757           0.2206215801974e-08, 0.4971131250731e+01, 0.6281667977667e+01,
5758           0.2205469554680e-08, 0.1677462357110e+01, 0.6284483723224e+01,
5759           0.2148792362509e-08, 0.4236259604006e+01, 0.1980482729015e+02,
5760           0.1873733657847e-08, 0.5926814998687e+01, 0.2876692439167e+02,
5761           0.2026573758959e-08, 0.4349643351962e+01, 0.2449240616245e+02,
5762           0.1807770325110e-08, 0.5700940482701e+01, 0.2045286941806e+02,
5763           0.1881174408581e-08, 0.6601286363430e+00, 0.2358125818164e+02,
5764 
5765           0.1368023671690e-08, 0.2211098592752e+01, 0.2473415438279e+02,
5766           0.1720017916280e-08, 0.4942488551129e+01, 0.1679593901136e+03,
5767           0.1702427665131e-08, 0.1452233856386e+01, 0.3338575901272e+03,
5768           0.1414032510054e-08, 0.5525357721439e+01, 0.1624205518357e+03,
5769           0.1652626045364e-08, 0.4108794283624e+01, 0.8956999012000e+02,
5770           0.1642957769686e-08, 0.7344335209984e+00, 0.5267006960365e+02,
5771           0.1614952403624e-08, 0.3541213951363e+01, 0.3332657872986e+02,
5772           0.1535988291188e-08, 0.4031094072151e+01, 0.3852657435933e+02,
5773           0.1593193738177e-08, 0.4185136203609e+01, 0.2282781046519e+03,
5774           0.1074569126382e-08, 0.1720485636868e+01, 0.8397383534231e+02,
5775 
5776           0.1074408214509e-08, 0.2758613420318e+01, 0.8401985929482e+02,
5777           0.9700199670465e-09, 0.4216686842097e+01, 0.7826370942180e+02,
5778           0.1258433517061e-08, 0.2575068876639e+00, 0.3115650189215e+03,
5779           0.1240303229539e-08, 0.4800844956756e+00, 0.1784300471910e+03,
5780           0.9018345948127e-09, 0.3896756361552e+00, 0.5886454391678e+02,
5781           0.1135301432805e-08, 0.3700805023550e+00, 0.7842370451713e+02,
5782           0.9215887951370e-09, 0.4364579276638e+01, 0.1014262087719e+03,
5783           0.1055401054147e-08, 0.2156564222111e+01, 0.5660027930059e+02,
5784           0.1008725979831e-08, 0.5454015785234e+01, 0.4245678405627e+02,
5785           0.7217398104321e-09, 0.1597772562175e+01, 0.2457074661053e+03,
5786 
5787           0.6912033134447e-09, 0.5824090621461e+01, 0.1679936946371e+03,
5788           0.6833881523549e-09, 0.3578778482835e+01, 0.6053048899753e+02,
5789           0.4887304205142e-09, 0.3724362812423e+01, 0.9656299901946e+02,
5790           0.5173709754788e-09, 0.5422427507933e+01, 0.2442876000072e+03,
5791           0.4671353097145e-09, 0.2396106924439e+01, 0.1435713242844e+03,
5792           0.5652608439480e-09, 0.2804028838685e+01, 0.8365903305582e+02,
5793           0.5604061331253e-09, 0.1638816006247e+01, 0.8433466158131e+02,
5794           0.4712723365400e-09, 0.8979003224474e+00, 0.3164282286739e+03,
5795           0.4909967465112e-09, 0.3210426725516e+01, 0.4059982187939e+03,
5796           0.4771358267658e-09, 0.5308027211629e+01, 0.1805255418145e+03,
5797 
5798           0.3943451445989e-09, 0.2195145341074e+01, 0.2568537517081e+03,
5799           0.3952109120244e-09, 0.5081189491586e+01, 0.2449975330562e+03,
5800           0.3788134594789e-09, 0.4345171264441e+01, 0.1568131045107e+03,
5801           0.3738330190479e-09, 0.2613062847997e+01, 0.3948519331910e+03,
5802           0.3099866678136e-09, 0.2846760817689e+01, 0.1547176098872e+03,
5803           0.2002962716768e-09, 0.4921360989412e+01, 0.2268582385539e+03,
5804           0.2198291338754e-09, 0.1130360117454e+00, 0.1658638954901e+03,
5805           0.1491958330784e-09, 0.4228195232278e+01, 0.2219950288015e+03,
5806           0.1475384076173e-09, 0.3005721811604e+00, 0.3052819430710e+03,
5807           0.1661626624624e-09, 0.7830125621203e+00, 0.2526661704812e+03,
5808 
5809           0.9015823460025e-10, 0.3807792942715e+01, 0.4171445043968e+03 };
5810 
5811     /* Sun-to-Earth, T^0, Y */
5812       static final double e0y[] = {
5813           0.9998921098898e+00, 0.1826583913846e+00, 0.6283075850446e+01,
5814          -0.2442700893735e-01, 0.0000000000000e+00, 0.0000000000000e+00,
5815           0.8352929742915e-02, 0.1395277998680e+00, 0.1256615170089e+02,
5816           0.1046697300177e-03, 0.9641423109763e-01, 0.1884922755134e+02,
5817           0.3110841876663e-04, 0.5381140401712e+01, 0.8399684731857e+02,
5818           0.2570269094593e-04, 0.5301016407128e+01, 0.5296909721118e+00,
5819           0.2147389623610e-04, 0.2662510869850e+01, 0.1577343543434e+01,
5820           0.1680344384050e-04, 0.5207904119704e+01, 0.6279552690824e+01,
5821           0.1679117312193e-04, 0.4582187486968e+01, 0.6286599010068e+01,
5822           0.1440512068440e-04, 0.1900688517726e+01, 0.2352866153506e+01,
5823 
5824           0.1135139664999e-04, 0.5273108538556e+01, 0.5223693906222e+01,
5825           0.9345482571018e-05, 0.4503047687738e+01, 0.1203646072878e+02,
5826           0.9007418719568e-05, 0.1605621059637e+01, 0.1021328554739e+02,
5827           0.5671536712314e-05, 0.5812849070861e+00, 0.1059381944224e+01,
5828           0.7451401861666e-05, 0.2807346794836e+01, 0.3981490189893e+00,
5829           0.6393470057114e-05, 0.6029224133855e+01, 0.5753384878334e+01,
5830           0.6814275881697e-05, 0.6472990145974e+00, 0.4705732307012e+01,
5831           0.6113705628887e-05, 0.3813843419700e+01, 0.6812766822558e+01,
5832           0.4503851367273e-05, 0.4527804370996e+01, 0.5884926831456e+01,
5833           0.4522249141926e-05, 0.5991783029224e+01, 0.6256777527156e+01,
5834 
5835           0.4501794307018e-05, 0.3798703844397e+01, 0.6309374173736e+01,
5836           0.5514927480180e-05, 0.3961257833388e+01, 0.5507553240374e+01,
5837           0.4062862799995e-05, 0.5256247296369e+01, 0.6681224869435e+01,
5838           0.5414900429712e-05, 0.5499032014097e+01, 0.7755226100720e+00,
5839           0.5463153987424e-05, 0.6173092454097e+01, 0.1414349524433e+02,
5840           0.5071611859329e-05, 0.2870244247651e+01, 0.7860419393880e+01,
5841           0.2195112094455e-05, 0.2952338617201e+01, 0.1150676975667e+02,
5842           0.2279139233919e-05, 0.5951775132933e+01, 0.7058598460518e+01,
5843           0.2278386100876e-05, 0.4845456398785e+01, 0.4694002934110e+01,
5844           0.2559088003308e-05, 0.6945321117311e+00, 0.1216800268190e+02,
5845 
5846           0.2561079286856e-05, 0.6167224608301e+01, 0.7099330490126e+00,
5847           0.1792755796387e-05, 0.1400122509632e+01, 0.7962980379786e+00,
5848           0.1818715656502e-05, 0.4703347611830e+01, 0.6283142985870e+01,
5849           0.1818744924791e-05, 0.5086748900237e+01, 0.6283008715021e+01,
5850           0.1554518791390e-05, 0.5331008042713e-01, 0.2513230340178e+02,
5851           0.2063265737239e-05, 0.4283680484178e+01, 0.1179062909082e+02,
5852           0.1497613520041e-05, 0.6074207826073e+01, 0.5486777812467e+01,
5853           0.2000617940427e-05, 0.2501426281450e+01, 0.1778984560711e+02,
5854           0.1289731195580e-05, 0.3646340599536e+01, 0.7079373888424e+01,
5855           0.1282657998934e-05, 0.3232864804902e+01, 0.3738761453707e+01,
5856 
5857           0.1528915968658e-05, 0.5581433416669e+01, 0.2132990797783e+00,
5858           0.1187304098432e-05, 0.5453576453694e+01, 0.9437762937313e+01,
5859           0.7842782928118e-06, 0.2823953922273e+00, 0.8827390247185e+01,
5860           0.7352892280868e-06, 0.1124369580175e+01, 0.1589072916335e+01,
5861           0.6570189360797e-06, 0.2089154042840e+01, 0.1176985366291e+02,
5862           0.6324967590410e-06, 0.6704855581230e+00, 0.6262300422539e+01,
5863           0.6298289872283e-06, 0.2836414855840e+01, 0.6303851278352e+01,
5864           0.6476686465855e-06, 0.4852433866467e+00, 0.7113454667900e-02,
5865           0.8587034651234e-06, 0.1453511005668e+01, 0.1672837615881e+03,
5866           0.8068948788113e-06, 0.9224087798609e+00, 0.6069776770667e+01,
5867 
5868           0.8353786011661e-06, 0.4631707184895e+01, 0.3340612434717e+01,
5869           0.6009324532132e-06, 0.1829498827726e+01, 0.4136910472696e+01,
5870           0.7558158559566e-06, 0.2588596800317e+01, 0.6496374930224e+01,
5871           0.5809279504503e-06, 0.5516818853476e+00, 0.1097707878456e+02,
5872           0.5374131950254e-06, 0.6275674734960e+01, 0.1194447056968e+01,
5873           0.5711160507326e-06, 0.1091905956872e+01, 0.6282095334605e+01,
5874           0.5710183170746e-06, 0.2415001635090e+01, 0.6284056366286e+01,
5875           0.5144373590610e-06, 0.6020336443438e+01, 0.6290189305114e+01,
5876           0.5103108927267e-06, 0.3775634564605e+01, 0.6275962395778e+01,
5877           0.4960654697891e-06, 0.1073450946756e+01, 0.6127655567643e+01,
5878 
5879           0.4786385689280e-06, 0.2431178012310e+01, 0.6438496133249e+01,
5880           0.6109911263665e-06, 0.5343356157914e+01, 0.3154687086868e+01,
5881           0.4839898944024e-06, 0.5830833594047e-01, 0.8018209333619e+00,
5882           0.4734822623919e-06, 0.4536080134821e+01, 0.3128388763578e+01,
5883           0.4834741473290e-06, 0.2585090489754e+00, 0.7084896783808e+01,
5884           0.5134858581156e-06, 0.4213317172603e+01, 0.1235285262111e+02,
5885           0.5064004264978e-06, 0.4814418806478e+00, 0.1185621865188e+02,
5886           0.3753476772761e-06, 0.1599953399788e+01, 0.8429241228195e+01,
5887           0.4935264014283e-06, 0.2157417556873e+01, 0.2544314396739e+01,
5888           0.3950929600897e-06, 0.3359394184254e+01, 0.5481254917084e+01,
5889 
5890           0.4895849789777e-06, 0.5165704376558e+01, 0.9225539266174e+01,
5891           0.4215241688886e-06, 0.2065368800993e+01, 0.1726015463500e+02,
5892           0.3796773731132e-06, 0.1468606346612e+01, 0.4265981595566e+00,
5893           0.3114178142515e-06, 0.3615638079474e+01, 0.2146165377750e+01,
5894           0.3260664220838e-06, 0.4417134922435e+01, 0.4164311961999e+01,
5895           0.3976996123008e-06, 0.4700866883004e+01, 0.5856477690889e+01,
5896           0.2801459672924e-06, 0.4538902060922e+01, 0.1256967486051e+02,
5897           0.3638931868861e-06, 0.1334197991475e+01, 0.1807370494127e+02,
5898           0.2487013269476e-06, 0.3749275558275e+01, 0.2629832328990e-01,
5899           0.3034165481994e-06, 0.4236622030873e+00, 0.4535059491685e+01,
5900 
5901           0.2676278825586e-06, 0.5970848007811e+01, 0.3930209696940e+01,
5902           0.2764903818918e-06, 0.5194636754501e+01, 0.1256262854127e+02,
5903           0.2485149930507e-06, 0.1002434207846e+01, 0.5088628793478e+01,
5904           0.2199305540941e-06, 0.3066773098403e+01, 0.1255903824622e+02,
5905           0.2571106500435e-06, 0.7588312459063e+00, 0.1336797263425e+02,
5906           0.2049751817158e-06, 0.3444977434856e+01, 0.1137170464392e+02,
5907           0.2599707296297e-06, 0.1873128542205e+01, 0.7143069561767e+02,
5908           0.1785018072217e-06, 0.5015891306615e+01, 0.1748016358760e+01,
5909           0.2324833891115e-06, 0.4618271239730e+01, 0.1831953657923e+02,
5910           0.1709711119545e-06, 0.5300003455669e+01, 0.4933208510675e+01,
5911 
5912           0.2107159351716e-06, 0.2229819815115e+01, 0.7477522907414e+01,
5913           0.1750333080295e-06, 0.6161485880008e+01, 0.1044738781244e+02,
5914           0.2000598210339e-06, 0.2967357299999e+01, 0.8031092209206e+01,
5915           0.1380920248681e-06, 0.3027007923917e+01, 0.8635942003952e+01,
5916           0.1412460470299e-06, 0.6037597163798e+01, 0.2942463415728e+01,
5917           0.1888459803001e-06, 0.8561476243374e+00, 0.1561374759853e+03,
5918           0.1788370542585e-06, 0.4869736290209e+01, 0.1592596075957e+01,
5919           0.1360893296167e-06, 0.3626411886436e+01, 0.1309584267300e+02,
5920           0.1506846530160e-06, 0.1550975377427e+01, 0.1649636139783e+02,
5921           0.1800913376176e-06, 0.2075826033190e+01, 0.1729818233119e+02,
5922 
5923           0.1436261390649e-06, 0.6148876420255e+01, 0.2042657109477e+02,
5924           0.1220227114151e-06, 0.4382583879906e+01, 0.7632943190217e+01,
5925           0.1337883603592e-06, 0.2036644327361e+01, 0.1213955354133e+02,
5926           0.1159326650738e-06, 0.3892276994687e+01, 0.5331357529664e+01,
5927           0.1352853128569e-06, 0.1447950649744e+01, 0.1673046366289e+02,
5928           0.1433408296083e-06, 0.4457854692961e+01, 0.7342457794669e+01,
5929           0.1234701666518e-06, 0.1538818147151e+01, 0.6279485555400e+01,
5930           0.1234027192007e-06, 0.1968523220760e+01, 0.6286666145492e+01,
5931           0.1244024091797e-06, 0.5779803499985e+01, 0.1511046609763e+02,
5932           0.1097934945516e-06, 0.6210975221388e+00, 0.1098880815746e+02,
5933 
5934           0.1254611329856e-06, 0.2591963807998e+01, 0.1572083878776e+02,
5935           0.1158247286784e-06, 0.2483612812670e+01, 0.5729506548653e+01,
5936           0.9039078252960e-07, 0.3857554579796e+01, 0.9623688285163e+01,
5937           0.9108024978836e-07, 0.5826368512984e+01, 0.7234794171227e+01,
5938           0.8887068108436e-07, 0.3475694573987e+01, 0.6148010737701e+01,
5939           0.8632374035438e-07, 0.3059070488983e-01, 0.6418140963190e+01,
5940           0.7893186992967e-07, 0.1583194837728e+01, 0.2118763888447e+01,
5941           0.8297650201172e-07, 0.8519770534637e+00, 0.1471231707864e+02,
5942           0.1019759578988e-06, 0.1319598738732e+00, 0.1349867339771e+01,
5943           0.1010037696236e-06, 0.9937860115618e+00, 0.6836645152238e+01,
5944 
5945           0.1047727548266e-06, 0.1382138405399e+01, 0.5999216516294e+01,
5946           0.7351993881086e-07, 0.3833397851735e+01, 0.6040347114260e+01,
5947           0.9868771092341e-07, 0.2124913814390e+01, 0.6566935184597e+01,
5948           0.7007321959390e-07, 0.5946305343763e+01, 0.6525804586632e+01,
5949           0.6861411679709e-07, 0.4574654977089e+01, 0.7238675589263e+01,
5950           0.7554519809614e-07, 0.5949232686844e+01, 0.1253985337760e+02,
5951           0.9541880448335e-07, 0.3495242990564e+01, 0.2122839202813e+02,
5952           0.7185606722155e-07, 0.4310113471661e+01, 0.6245048154254e+01,
5953           0.7131360871710e-07, 0.5480309323650e+01, 0.6321103546637e+01,
5954           0.6651142021039e-07, 0.5411097713654e+01, 0.5327476111629e+01,
5955 
5956           0.8538618213667e-07, 0.1827849973951e+01, 0.1101510648075e+02,
5957           0.8634954288044e-07, 0.5443584943349e+01, 0.5643178611111e+01,
5958           0.7449415051484e-07, 0.2011535459060e+01, 0.5368044267797e+00,
5959           0.7421047599169e-07, 0.3464562529249e+01, 0.2354323048545e+02,
5960           0.6140694354424e-07, 0.5657556228815e+01, 0.1296430071988e+02,
5961           0.6353525143033e-07, 0.3463816593821e+01, 0.1990745094947e+01,
5962           0.6221964013447e-07, 0.1532259498697e+01, 0.9517183207817e+00,
5963           0.5852480257244e-07, 0.1375396598875e+01, 0.9555997388169e+00,
5964           0.6398637498911e-07, 0.2405645801972e+01, 0.2407292145756e+02,
5965           0.7039744069878e-07, 0.5397541799027e+01, 0.5225775174439e+00,
5966 
5967           0.6977997694382e-07, 0.4762347105419e+01, 0.1097355562493e+02,
5968           0.7460629558396e-07, 0.2711944692164e+01, 0.2200391463820e+02,
5969           0.5376577536101e-07, 0.2352980430239e+01, 0.1431416805965e+02,
5970           0.7530607893556e-07, 0.1943940180699e+01, 0.1842262939178e+02,
5971           0.6822928971605e-07, 0.4337651846959e+01, 0.1554202828031e+00,
5972           0.6220772380094e-07, 0.6716871369278e+00, 0.1845107853235e+02,
5973           0.6586950799043e-07, 0.2229714460505e+01, 0.5216580451554e+01,
5974           0.5873800565771e-07, 0.7627013920580e+00, 0.6398972393349e+00,
5975           0.6264346929745e-07, 0.6202785478961e+00, 0.6277552955062e+01,
5976           0.6257929115669e-07, 0.2886775596668e+01, 0.6288598745829e+01,
5977 
5978           0.5343536033409e-07, 0.1977241012051e+01, 0.4690479774488e+01,
5979           0.5587849781714e-07, 0.1922923484825e+01, 0.1551045220144e+01,
5980           0.6905100845603e-07, 0.3570757164631e+01, 0.1030928125552e+00,
5981           0.6178957066649e-07, 0.5197558947765e+01, 0.5230807360890e+01,
5982           0.6187270224331e-07, 0.8193497368922e+00, 0.5650292065779e+01,
5983           0.5385664291426e-07, 0.5406336665586e+01, 0.7771377146812e+02,
5984           0.6329363917926e-07, 0.2837760654536e+01, 0.2608790314060e+02,
5985           0.4546018761604e-07, 0.2933580297050e+01, 0.5535693017924e+00,
5986           0.6196091049375e-07, 0.4157871494377e+01, 0.8467247584405e+02,
5987           0.6159555108218e-07, 0.3211703561703e+01, 0.2394243902548e+03,
5988 
5989           0.4995340539317e-07, 0.1459098102922e+01, 0.4732030630302e+01,
5990           0.5457031243572e-07, 0.1430457676136e+01, 0.6179983037890e+01,
5991           0.4863461418397e-07, 0.2196425916730e+01, 0.9027992316901e+02,
5992           0.5342947626870e-07, 0.2086612890268e+01, 0.6386168663001e+01,
5993           0.5674296648439e-07, 0.2760204966535e+01, 0.6915859635113e+01,
5994           0.4745783120161e-07, 0.4245368971862e+01, 0.6282970628506e+01,
5995           0.4745676961198e-07, 0.5544725787016e+01, 0.6283181072386e+01,
5996           0.4049796869973e-07, 0.2213984363586e+01, 0.6254626709878e+01,
5997           0.4248333596940e-07, 0.8075781952896e+00, 0.7875671926403e+01,
5998           0.4027178070205e-07, 0.1293268540378e+01, 0.6311524991013e+01,
5999 
6000           0.4066543943476e-07, 0.3986141175804e+01, 0.3634620989887e+01,
6001           0.4858863787880e-07, 0.1276112738231e+01, 0.5760498333002e+01,
6002           0.5277398263530e-07, 0.4916111741527e+01, 0.2515860172507e+02,
6003           0.4105635656559e-07, 0.1725805864426e+01, 0.6709674010002e+01,
6004           0.4376781925772e-07, 0.2243642442106e+01, 0.6805653367890e+01,
6005           0.3235827894693e-07, 0.3614135118271e+01, 0.1066495398892e+01,
6006           0.3073244740308e-07, 0.2460873393460e+01, 0.5863591145557e+01,
6007           0.3088609271373e-07, 0.5678431771790e+01, 0.9917696840332e+01,
6008           0.3393022279836e-07, 0.3814017477291e+01, 0.1391601904066e+02,
6009           0.3038686508802e-07, 0.4660216229171e+01, 0.1256621883632e+02,
6010 
6011           0.4019677752497e-07, 0.5906906243735e+01, 0.1334167431096e+02,
6012           0.3288834998232e-07, 0.9536146445882e+00, 0.1620077269078e+02,
6013           0.3889973794631e-07, 0.3942205097644e+01, 0.7478166569050e-01,
6014           0.3050438987141e-07, 0.1624810271286e+01, 0.1805292951336e+02,
6015           0.3601142564638e-07, 0.4030467142575e+01, 0.6208294184755e+01,
6016           0.3689015557141e-07, 0.3648878818694e+01, 0.5966683958112e+01,
6017           0.3563471893565e-07, 0.5749584017096e+01, 0.6357857516136e+01,
6018           0.2776183170667e-07, 0.2630124187070e+01, 0.3523159621801e-02,
6019           0.2922350530341e-07, 0.1790346403629e+01, 0.1272157198369e+02,
6020           0.3511076917302e-07, 0.6142198301611e+01, 0.6599467742779e+01,
6021 
6022           0.3619351007632e-07, 0.1432421386492e+01, 0.6019991944201e+01,
6023           0.2561254711098e-07, 0.2302822475792e+01, 0.1259245002418e+02,
6024           0.2626903942920e-07, 0.8660470994571e+00, 0.6702560555334e+01,
6025           0.2550187397083e-07, 0.6069721995383e+01, 0.1057540660594e+02,
6026           0.2535873526138e-07, 0.1079020331795e-01, 0.3141537925223e+02,
6027           0.3519786153847e-07, 0.3809066902283e+01, 0.2505706758577e+03,
6028           0.3424651492873e-07, 0.2075435114417e+01, 0.6546159756691e+01,
6029           0.2372676630861e-07, 0.2057803120154e+01, 0.2388894113936e+01,
6030           0.2710980779541e-07, 0.1510068488010e+01, 0.1202934727411e+02,
6031           0.3038710889704e-07, 0.5043617528901e+01, 0.1256608456547e+02,
6032 
6033           0.2220364130585e-07, 0.3694793218205e+01, 0.1336244973887e+02,
6034           0.3025880825460e-07, 0.5450618999049e-01, 0.2908881142201e+02,
6035           0.2784493486864e-07, 0.3381164084502e+01, 0.1494531617769e+02,
6036           0.2294414142438e-07, 0.4382309025210e+01, 0.6076890225335e+01,
6037           0.2012723294724e-07, 0.9142212256518e+00, 0.6262720680387e+01,
6038           0.2036357831958e-07, 0.5676172293154e+01, 0.4701116388778e+01,
6039           0.2003474823288e-07, 0.2592767977625e+01, 0.6303431020504e+01,
6040           0.2207144900109e-07, 0.5404976271180e+01, 0.6489261475556e+01,
6041           0.2481664905135e-07, 0.4373284587027e+01, 0.1204357418345e+02,
6042           0.2674949182295e-07, 0.5859182188482e+01, 0.4590910121555e+01,
6043 
6044           0.2450554720322e-07, 0.4555381557451e+01, 0.1495633313810e+00,
6045           0.2601975986457e-07, 0.3933165584959e+01, 0.1965104848470e+02,
6046           0.2199860022848e-07, 0.5227977189087e+01, 0.1351787002167e+02,
6047           0.2448121172316e-07, 0.4858060353949e+01, 0.1162474756779e+01,
6048           0.1876014864049e-07, 0.5690546553605e+01, 0.6279194432410e+01,
6049           0.1874513219396e-07, 0.4099539297446e+01, 0.6286957268481e+01,
6050           0.2156380842559e-07, 0.4382594769913e+00, 0.1813929450232e+02,
6051           0.1981691240061e-07, 0.1829784152444e+01, 0.4686889479442e+01,
6052           0.2329992648539e-07, 0.2836254278973e+01, 0.1002183730415e+02,
6053           0.1765184135302e-07, 0.2803494925833e+01, 0.4292330755499e+01,
6054 
6055           0.2436368366085e-07, 0.2836897959677e+01, 0.9514313292143e+02,
6056           0.2164089203889e-07, 0.6127522446024e+01, 0.6037244212485e+01,
6057           0.1847755034221e-07, 0.3683163635008e+01, 0.2427287361862e+00,
6058           0.1674798769966e-07, 0.3316993867246e+00, 0.1311972100268e+02,
6059           0.2222542124356e-07, 0.8294097805480e+00, 0.1266924451345e+02,
6060           0.2071074505925e-07, 0.3659492220261e+01, 0.6528907488406e+01,
6061           0.1608224471835e-07, 0.4774492067182e+01, 0.1352175143971e+02,
6062           0.1857583439071e-07, 0.2873120597682e+01, 0.8662240327241e+01,
6063           0.1793018836159e-07, 0.5282441177929e+00, 0.6819880277225e+01,
6064           0.1575391221692e-07, 0.1320789654258e+01, 0.1102062672231e+00,
6065 
6066           0.1840132009557e-07, 0.1917110916256e+01, 0.6514761976723e+02,
6067           0.1760917288281e-07, 0.2972635937132e+01, 0.5746271423666e+01,
6068           0.1561779518516e-07, 0.4372569261981e+01, 0.6272439236156e+01,
6069           0.1558687885205e-07, 0.5416424926425e+01, 0.6293712464735e+01,
6070           0.1951359382579e-07, 0.3094448898752e+01, 0.2301353951334e+02,
6071           0.1569144275614e-07, 0.2802103689808e+01, 0.1765478049437e+02,
6072           0.1479130389462e-07, 0.2136435020467e+01, 0.2077542790660e-01,
6073           0.1467828510764e-07, 0.7072627435674e+00, 0.1052268489556e+01,
6074           0.1627627337440e-07, 0.3947607143237e+01, 0.6327837846670e+00,
6075           0.1503498479758e-07, 0.4079248909190e+01, 0.7626583626240e-01,
6076 
6077           0.1297967708237e-07, 0.6269637122840e+01, 0.1149965630200e+02,
6078           0.1374416896634e-07, 0.4175657970702e+01, 0.6016468784579e+01,
6079           0.1783812325219e-07, 0.1476540547560e+01, 0.3301902111895e+02,
6080           0.1525884228756e-07, 0.4653477715241e+01, 0.9411464614024e+01,
6081           0.1451067396763e-07, 0.2573001128225e+01, 0.1277945078067e+02,
6082           0.1297713111950e-07, 0.5612799618771e+01, 0.6549682916313e+01,
6083           0.1462784012820e-07, 0.4189661623870e+01, 0.1863592847156e+02,
6084           0.1384185980007e-07, 0.2656915472196e+01, 0.2379164476796e+01,
6085           0.1221497599801e-07, 0.5612515760138e+01, 0.1257326515556e+02,
6086           0.1560574525896e-07, 0.4783414317919e+01, 0.1887552587463e+02,
6087 
6088           0.1544598372036e-07, 0.2694431138063e+01, 0.1820933031200e+02,
6089           0.1531678928696e-07, 0.4105103489666e+01, 0.2593412433514e+02,
6090           0.1349321503795e-07, 0.3082437194015e+00, 0.5120601093667e+01,
6091           0.1252030290917e-07, 0.6124072334087e+01, 0.6993008899458e+01,
6092           0.1459243816687e-07, 0.3733103981697e+01, 0.3813291813120e-01,
6093           0.1226103625262e-07, 0.1267127706817e+01, 0.2435678079171e+02,
6094           0.1019449641504e-07, 0.4367790112269e+01, 0.1725663147538e+02,
6095           0.1380789433607e-07, 0.3387201768700e+01, 0.2458316379602e+00,
6096           0.1019453421658e-07, 0.9204143073737e+00, 0.6112403035119e+01,
6097           0.1297929434405e-07, 0.5786874896426e+01, 0.1249137003520e+02,
6098 
6099           0.9912677786097e-08, 0.3164232870746e+01, 0.6247047890016e+01,
6100           0.9829386098599e-08, 0.2586762413351e+01, 0.6453748665772e+01,
6101           0.1226807746104e-07, 0.6239068436607e+01, 0.5429879531333e+01,
6102           0.1192691755997e-07, 0.1867380051424e+01, 0.6290122169689e+01,
6103           0.9836499227081e-08, 0.3424716293727e+00, 0.6319103810876e+01,
6104           0.9642862564285e-08, 0.5661372990657e+01, 0.8273820945392e+01,
6105           0.1165184404862e-07, 0.5768367239093e+01, 0.1778273215245e+02,
6106           0.1175794418818e-07, 0.1657351222943e+01, 0.6276029531202e+01,
6107           0.1018948635601e-07, 0.6458292350865e+00, 0.1254537627298e+02,
6108           0.9500383606676e-08, 0.1054306140741e+01, 0.1256517118505e+02,
6109 
6110           0.1227512202906e-07, 0.2505278379114e+01, 0.2248384854122e+02,
6111           0.9664792009993e-08, 0.4289737277000e+01, 0.6259197520765e+01,
6112           0.9613285666331e-08, 0.5500597673141e+01, 0.6306954180126e+01,
6113           0.1117906736211e-07, 0.2361405953468e+01, 0.1779695906178e+02,
6114           0.9611378640782e-08, 0.2851310576269e+01, 0.2061856251104e+00,
6115           0.8845354852370e-08, 0.6208777705343e+01, 0.1692165728891e+01,
6116           0.1054046966600e-07, 0.5413091423934e+01, 0.2204125344462e+00,
6117           0.1215539124483e-07, 0.5613969479755e+01, 0.8257698122054e+02,
6118           0.9932460955209e-08, 0.1106124877015e+01, 0.1017725758696e+02,
6119           0.8785804715043e-08, 0.2869224476477e+01, 0.9491756770005e+00,
6120 
6121           0.8538084097562e-08, 0.6159640899344e+01, 0.6393282117669e+01,
6122           0.8648994369529e-08, 0.1374901198784e+01, 0.4804209201333e+01,
6123           0.1039063219067e-07, 0.5171080641327e+01, 0.1550861511662e+02,
6124           0.8867983926439e-08, 0.8317320304902e+00, 0.3903911373650e+01,
6125           0.8327495955244e-08, 0.3605591969180e+01, 0.6172869583223e+01,
6126           0.9243088356133e-08, 0.6114299196843e+01, 0.6267823317922e+01,
6127           0.9205657357835e-08, 0.3675153683737e+01, 0.6298328382969e+01,
6128           0.1033269714606e-07, 0.3313328813024e+01, 0.5573142801433e+01,
6129           0.8001706275552e-08, 0.2019980960053e+01, 0.2648454860559e+01,
6130           0.9171858254191e-08, 0.8992015524177e+00, 0.1498544001348e+03,
6131 
6132           0.1075327150242e-07, 0.2898669963648e+01, 0.3694923081589e+02,
6133           0.9884866689828e-08, 0.4946715904478e+01, 0.1140367694411e+02,
6134           0.9541835576677e-08, 0.2371787888469e+01, 0.1256713221673e+02,
6135           0.7739903376237e-08, 0.2213775190612e+01, 0.7834121070590e+01,
6136           0.7311962684106e-08, 0.3429378787739e+01, 0.1192625446156e+02,
6137           0.9724904869624e-08, 0.6195878564404e+01, 0.2280573557157e+02,
6138           0.9251628983612e-08, 0.6511509527390e+00, 0.2787043132925e+01,
6139           0.7320763787842e-08, 0.6001083639421e+01, 0.6282655592598e+01,
6140           0.7320296650962e-08, 0.3789073265087e+01, 0.6283496108294e+01,
6141           0.7947032271039e-08, 0.1059659582204e+01, 0.1241073141809e+02,
6142 
6143           0.9005277053115e-08, 0.1280315624361e+01, 0.6281591679874e+01,
6144           0.8995601652048e-08, 0.2224439106766e+01, 0.6284560021018e+01,
6145           0.8288040568796e-08, 0.5234914433867e+01, 0.1241658836951e+02,
6146           0.6359381347255e-08, 0.4137989441490e+01, 0.1596186371003e+01,
6147           0.8699572228626e-08, 0.1758411009497e+01, 0.6133512519065e+01,
6148           0.6456797542736e-08, 0.5919285089994e+01, 0.1685848245639e+02,
6149           0.7424573475452e-08, 0.5414616938827e+01, 0.4061219149443e+01,
6150           0.7235671196168e-08, 0.1496516557134e+01, 0.1610006857377e+03,
6151           0.8104015182733e-08, 0.1919918242764e+01, 0.8460828644453e+00,
6152           0.8098576535937e-08, 0.3819615855458e+01, 0.3894181736510e+01,
6153 
6154           0.6275292346625e-08, 0.6244264115141e+01, 0.8531963191132e+00,
6155           0.6052432989112e-08, 0.5037731872610e+00, 0.1567108171867e+02,
6156           0.5705651535817e-08, 0.2984557271995e+01, 0.1258692712880e+02,
6157           0.5789650115138e-08, 0.6087038140697e+01, 0.1193336791622e+02,
6158           0.5512132153377e-08, 0.5855668994076e+01, 0.1232342296471e+02,
6159           0.7388890819102e-08, 0.2443128574740e+01, 0.4907302013889e+01,
6160           0.5467593991798e-08, 0.3017561234194e+01, 0.1884211409667e+02,
6161           0.6388519802999e-08, 0.5887386712935e+01, 0.5217580628120e+02,
6162           0.6106777149944e-08, 0.3483461059895e+00, 0.1422690933580e-01,
6163           0.7383420275489e-08, 0.5417387056707e+01, 0.2358125818164e+02,
6164 
6165           0.5505208141738e-08, 0.2848193644783e+01, 0.1151388321134e+02,
6166           0.6310757462877e-08, 0.2349882520828e+01, 0.1041998632314e+02,
6167           0.6166904929691e-08, 0.5728575944077e+00, 0.6151533897323e+01,
6168           0.5263442042754e-08, 0.4495796125937e+01, 0.1885275071096e+02,
6169           0.5591828082629e-08, 0.1355441967677e+01, 0.4337116142245e+00,
6170           0.5397051680497e-08, 0.1673422864307e+01, 0.6286362197481e+01,
6171           0.5396992745159e-08, 0.1833502206373e+01, 0.6279789503410e+01,
6172           0.6572913000726e-08, 0.3331122065824e+01, 0.1176433076753e+02,
6173           0.5123421866413e-08, 0.2165327142679e+01, 0.1245594543367e+02,
6174           0.5930495725999e-08, 0.2931146089284e+01, 0.6414617803568e+01,
6175 
6176           0.6431797403933e-08, 0.4134407994088e+01, 0.1350651127443e+00,
6177           0.5003182207604e-08, 0.3805420303749e+01, 0.1096996532989e+02,
6178           0.5587731032504e-08, 0.1082469260599e+01, 0.6062663316000e+01,
6179           0.5935263407816e-08, 0.8384333678401e+00, 0.5326786718777e+01,
6180           0.4756019827760e-08, 0.3552588749309e+01, 0.3104930017775e+01,
6181           0.6599951172637e-08, 0.4320826409528e+01, 0.4087944051283e+02,
6182           0.5902606868464e-08, 0.4811879454445e+01, 0.5849364236221e+01,
6183           0.5921147809031e-08, 0.9942628922396e-01, 0.1581959461667e+01,
6184           0.5505382581266e-08, 0.2466557607764e+01, 0.6503488384892e+01,
6185           0.5353771071862e-08, 0.4551978748683e+01, 0.1735668374386e+03,
6186 
6187           0.5063282210946e-08, 0.5710812312425e+01, 0.1248988586463e+02,
6188           0.5926120403383e-08, 0.1333998428358e+01, 0.2673594526851e+02,
6189           0.5211016176149e-08, 0.4649315360760e+01, 0.2460261242967e+02,
6190           0.5347075084894e-08, 0.5512754081205e+01, 0.4171425416666e+01,
6191           0.4872609773574e-08, 0.1308025299938e+01, 0.5333900173445e+01,
6192           0.4727711321420e-08, 0.2144908368062e+01, 0.7232251527446e+01,
6193           0.6029426018652e-08, 0.5567259412084e+01, 0.3227113045244e+03,
6194           0.4321485284369e-08, 0.5230667156451e+01, 0.9388005868221e+01,
6195           0.4476406760553e-08, 0.6134081115303e+01, 0.5547199253223e+01,
6196           0.5835268277420e-08, 0.4783808492071e+01, 0.7285056171570e+02,
6197 
6198           0.5172183602748e-08, 0.5161817911099e+01, 0.1884570439172e+02,
6199           0.5693571465184e-08, 0.1381646203111e+01, 0.9723862754494e+02,
6200           0.4060634965349e-08, 0.3876705259495e+00, 0.4274518229222e+01,
6201           0.3967398770473e-08, 0.5029491776223e+01, 0.3496032717521e+01,
6202           0.3943754005255e-08, 0.1923162955490e+01, 0.6244942932314e+01,
6203           0.4781323427824e-08, 0.4633332586423e+01, 0.2929661536378e+02,
6204           0.3871483781204e-08, 0.1616650009743e+01, 0.6321208768577e+01,
6205           0.5141741733997e-08, 0.9817316704659e-01, 0.1232032006293e+02,
6206           0.4002385978497e-08, 0.3656161212139e+01, 0.7018952447668e+01,
6207           0.4901092604097e-08, 0.4404098713092e+01, 0.1478866649112e+01,
6208 
6209           0.3740932630345e-08, 0.5181188732639e+00, 0.6922973089781e+01,
6210           0.4387283718538e-08, 0.3254859566869e+01, 0.2331413144044e+03,
6211           0.5019197802033e-08, 0.3086773224677e+01, 0.1715706182245e+02,
6212           0.3834931695175e-08, 0.2797882673542e+01, 0.1491901785440e+02,
6213           0.3760413942497e-08, 0.2892676280217e+01, 0.1726726808967e+02,
6214           0.3719717204628e-08, 0.5861046025739e+01, 0.6297302759782e+01,
6215           0.4145623530149e-08, 0.2168239627033e+01, 0.1376059875786e+02,
6216           0.3932788425380e-08, 0.6271811124181e+01, 0.7872148766781e+01,
6217           0.3686377476857e-08, 0.3936853151404e+01, 0.6268848941110e+01,
6218           0.3779077950339e-08, 0.1404148734043e+01, 0.4157198507331e+01,
6219 
6220           0.4091334550598e-08, 0.2452436180854e+01, 0.9779108567966e+01,
6221           0.3926694536146e-08, 0.6102292739040e+01, 0.1098419223922e+02,
6222           0.4841000253289e-08, 0.6072760457276e+01, 0.1252801878276e+02,
6223           0.4949340130240e-08, 0.1154832815171e+01, 0.1617106187867e+03,
6224           0.3761557737360e-08, 0.5527545321897e+01, 0.3185192151914e+01,
6225           0.3647396268188e-08, 0.1525035688629e+01, 0.6271346477544e+01,
6226           0.3932405074189e-08, 0.5570681040569e+01, 0.2139354194808e+02,
6227           0.3631322501141e-08, 0.1981240601160e+01, 0.6294805223347e+01,
6228           0.4130007425139e-08, 0.2050060880201e+01, 0.2195415756911e+02,
6229           0.4433905965176e-08, 0.3277477970321e+01, 0.7445550607224e+01,
6230 
6231           0.3851814176947e-08, 0.5210690074886e+01, 0.9562891316684e+00,
6232           0.3485807052785e-08, 0.6653274904611e+00, 0.1161697602389e+02,
6233           0.3979772816991e-08, 0.1767941436148e+01, 0.2277943724828e+02,
6234           0.3402607460500e-08, 0.3421746306465e+01, 0.1087398597200e+02,
6235           0.4049993000926e-08, 0.1127144787547e+01, 0.3163918923335e+00,
6236           0.3420511182382e-08, 0.4214794779161e+01, 0.1362553364512e+02,
6237           0.3640772365012e-08, 0.5324905497687e+01, 0.1725304118033e+02,
6238           0.3323037987501e-08, 0.6135761838271e+01, 0.6279143387820e+01,
6239           0.4503141663637e-08, 0.1802305450666e+01, 0.1385561574497e+01,
6240           0.4314560055588e-08, 0.4812299731574e+01, 0.4176041334900e+01,
6241 
6242           0.3294226949110e-08, 0.3657547059723e+01, 0.6287008313071e+01,
6243           0.3215657197281e-08, 0.4866676894425e+01, 0.5749861718712e+01,
6244           0.4129362656266e-08, 0.3809342558906e+01, 0.5905702259363e+01,
6245           0.3137762976388e-08, 0.2494635174443e+01, 0.2099539292909e+02,
6246           0.3514010952384e-08, 0.2699961831678e+01, 0.7335344340001e+01,
6247           0.3327607571530e-08, 0.3318457714816e+01, 0.5436992986000e+01,
6248           0.3541066946675e-08, 0.4382703582466e+01, 0.1234573916645e+02,
6249           0.3216179847052e-08, 0.5271066317054e+01, 0.3802769619140e-01,
6250           0.2959045059570e-08, 0.5819591585302e+01, 0.2670964694522e+02,
6251           0.3884040326665e-08, 0.5980934960428e+01, 0.6660449441528e+01,
6252 
6253           0.2922027539886e-08, 0.3337290282483e+01, 0.1375773836557e+01,
6254           0.4110846382042e-08, 0.5742978187327e+01, 0.4480965020977e+02,
6255           0.2934508411032e-08, 0.2278075804200e+01, 0.6408777551755e+00,
6256           0.3966896193000e-08, 0.5835747858477e+01, 0.3773735910827e+00,
6257           0.3286695827610e-08, 0.5838898193902e+01, 0.3932462625300e-02,
6258           0.3720643094196e-08, 0.1122212337858e+01, 0.1646033343740e+02,
6259           0.3285508906174e-08, 0.9182250996416e+00, 0.1081813534213e+02,
6260           0.3753880575973e-08, 0.5174761973266e+01, 0.5642198095270e+01,
6261           0.3022129385587e-08, 0.3381611020639e+01, 0.2982630633589e+02,
6262           0.2798569205621e-08, 0.3546193723922e+01, 0.1937891852345e+02,
6263 
6264           0.3397872070505e-08, 0.4533203197934e+01, 0.6923953605621e+01,
6265           0.3708099772977e-08, 0.2756168198616e+01, 0.3066615496545e+02,
6266           0.3599283541510e-08, 0.1934395469918e+01, 0.6147450479709e+01,
6267           0.3688702753059e-08, 0.7149920971109e+00, 0.2636725487657e+01,
6268           0.2681084724003e-08, 0.4899819493154e+01, 0.6816289982179e+01,
6269           0.3495993460759e-08, 0.1572418915115e+01, 0.6418701221183e+01,
6270           0.3130770324995e-08, 0.8912190180489e+00, 0.1235996607578e+02,
6271           0.2744353821941e-08, 0.3800821940055e+01, 0.2059724391010e+02,
6272           0.2842732906341e-08, 0.2644717440029e+01, 0.2828699048865e+02,
6273           0.3046882682154e-08, 0.3987793020179e+01, 0.6055599646783e+01,
6274 
6275           0.2399072455143e-08, 0.9908826440764e+00, 0.6255674361143e+01,
6276           0.2384306274204e-08, 0.2516149752220e+01, 0.6310477339748e+01,
6277           0.2977324500559e-08, 0.5849195642118e+01, 0.1652265972112e+02,
6278           0.3062835258972e-08, 0.1681660100162e+01, 0.1172006883645e+02,
6279           0.3109682589231e-08, 0.5804143987737e+00, 0.2751146787858e+02,
6280           0.2903920355299e-08, 0.5800768280123e+01, 0.6510552054109e+01,
6281           0.2823221989212e-08, 0.9241118370216e+00, 0.5469525544182e+01,
6282           0.3187949696649e-08, 0.3139776445735e+01, 0.1693792562116e+03,
6283           0.2922559771655e-08, 0.3549440782984e+01, 0.2630839062450e+00,
6284           0.2436302066603e-08, 0.4735540696319e+01, 0.3946258593675e+00,
6285 
6286           0.3049473043606e-08, 0.4998289124561e+01, 0.8390110365991e+01,
6287           0.2863682575784e-08, 0.6709515671102e+00, 0.2243449970715e+00,
6288           0.2641750517966e-08, 0.5410978257284e+01, 0.2986433403208e+02,
6289           0.2704093466243e-08, 0.4778317207821e+01, 0.6129297044991e+01,
6290           0.2445522177011e-08, 0.6009020662222e+01, 0.1171295538178e+02,
6291           0.2623608810230e-08, 0.5010449777147e+01, 0.6436854655901e+01,
6292           0.2079259704053e-08, 0.5980943768809e+01, 0.2019909489111e+02,
6293           0.2820225596771e-08, 0.2679965110468e+01, 0.5934151399930e+01,
6294           0.2365221950927e-08, 0.1894231148810e+01, 0.2470570524223e+02,
6295           0.2359682077149e-08, 0.4220752950780e+01, 0.8671969964381e+01,
6296 
6297           0.2387577137206e-08, 0.2571783940617e+01, 0.7096626156709e+01,
6298           0.1982102089816e-08, 0.5169765997119e+00, 0.1727188400790e+02,
6299           0.2687502389925e-08, 0.6239078264579e+01, 0.7075506709219e+02,
6300           0.2207751669135e-08, 0.2031184412677e+01, 0.4377611041777e+01,
6301           0.2618370214274e-08, 0.8266079985979e+00, 0.6632000300961e+01,
6302           0.2591951887361e-08, 0.8819350522008e+00, 0.4873985990671e+02,
6303           0.2375055656248e-08, 0.3520944177789e+01, 0.1590676413561e+02,
6304           0.2472019978911e-08, 0.1551431908671e+01, 0.6612329252343e+00,
6305           0.2368157127199e-08, 0.4178610147412e+01, 0.3459636466239e+02,
6306           0.1764846605693e-08, 0.1506764000157e+01, 0.1980094587212e+02,
6307 
6308           0.2291769608798e-08, 0.2118250611782e+01, 0.2844914056730e-01,
6309           0.2209997316943e-08, 0.3363255261678e+01, 0.2666070658668e+00,
6310           0.2292699097923e-08, 0.4200423956460e+00, 0.1484170571900e-02,
6311           0.1629683015329e-08, 0.2331362582487e+01, 0.3035599730800e+02,
6312           0.2206492862426e-08, 0.3400274026992e+01, 0.6281667977667e+01,
6313           0.2205746568257e-08, 0.1066051230724e+00, 0.6284483723224e+01,
6314           0.2026310767991e-08, 0.2779066487979e+01, 0.2449240616245e+02,
6315           0.1762977622163e-08, 0.9951450691840e+00, 0.2045286941806e+02,
6316           0.1368535049606e-08, 0.6402447365817e+00, 0.2473415438279e+02,
6317           0.1720598775450e-08, 0.2303524214705e+00, 0.1679593901136e+03,
6318 
6319           0.1702429015449e-08, 0.6164622655048e+01, 0.3338575901272e+03,
6320           0.1414033197685e-08, 0.3954561185580e+01, 0.1624205518357e+03,
6321           0.1573768958043e-08, 0.2028286308984e+01, 0.3144167757552e+02,
6322           0.1650705184447e-08, 0.2304040666128e+01, 0.5267006960365e+02,
6323           0.1651087618855e-08, 0.2538461057280e+01, 0.8956999012000e+02,
6324           0.1616409518983e-08, 0.5111054348152e+01, 0.3332657872986e+02,
6325           0.1537175173581e-08, 0.5601130666603e+01, 0.3852657435933e+02,
6326           0.1593191980553e-08, 0.2614340453411e+01, 0.2282781046519e+03,
6327           0.1499480170643e-08, 0.3624721577264e+01, 0.2823723341956e+02,
6328           0.1493807843235e-08, 0.4214569879008e+01, 0.2876692439167e+02,
6329 
6330           0.1074571199328e-08, 0.1496911744704e+00, 0.8397383534231e+02,
6331           0.1074406983417e-08, 0.1187817671922e+01, 0.8401985929482e+02,
6332           0.9757576855851e-09, 0.2655703035858e+01, 0.7826370942180e+02,
6333           0.1258432887565e-08, 0.4969896184844e+01, 0.3115650189215e+03,
6334           0.1240336343282e-08, 0.5192460776926e+01, 0.1784300471910e+03,
6335           0.9016107005164e-09, 0.1960356923057e+01, 0.5886454391678e+02,
6336           0.1135392360918e-08, 0.5082427809068e+01, 0.7842370451713e+02,
6337           0.9216046089565e-09, 0.2793775037273e+01, 0.1014262087719e+03,
6338           0.1061276615030e-08, 0.3726144311409e+01, 0.5660027930059e+02,
6339           0.1010110596263e-08, 0.7404080708937e+00, 0.4245678405627e+02,
6340 
6341           0.7217424756199e-09, 0.2697449980577e-01, 0.2457074661053e+03,
6342           0.6912003846756e-09, 0.4253296276335e+01, 0.1679936946371e+03,
6343           0.6871814664847e-09, 0.5148072412354e+01, 0.6053048899753e+02,
6344           0.4887158016343e-09, 0.2153581148294e+01, 0.9656299901946e+02,
6345           0.5161802866314e-09, 0.3852750634351e+01, 0.2442876000072e+03,
6346           0.5652599559057e-09, 0.1233233356270e+01, 0.8365903305582e+02,
6347           0.4710812608586e-09, 0.5610486976767e+01, 0.3164282286739e+03,
6348           0.4909977500324e-09, 0.1639629524123e+01, 0.4059982187939e+03,
6349           0.4772641839378e-09, 0.3737100368583e+01, 0.1805255418145e+03,
6350           0.4487562567153e-09, 0.1158417054478e+00, 0.8433466158131e+02,
6351 
6352           0.3943441230497e-09, 0.6243502862796e+00, 0.2568537517081e+03,
6353           0.3952236913598e-09, 0.3510377382385e+01, 0.2449975330562e+03,
6354           0.3788898363417e-09, 0.5916128302299e+01, 0.1568131045107e+03,
6355           0.3738329328831e-09, 0.1042266763456e+01, 0.3948519331910e+03,
6356           0.2451199165151e-09, 0.1166788435700e+01, 0.1435713242844e+03,
6357           0.2436734402904e-09, 0.3254726114901e+01, 0.2268582385539e+03,
6358           0.2213605274325e-09, 0.1687210598530e+01, 0.1658638954901e+03,
6359           0.1491521204829e-09, 0.2657541786794e+01, 0.2219950288015e+03,
6360           0.1474995329744e-09, 0.5013089805819e+01, 0.3052819430710e+03,
6361           0.1661939475656e-09, 0.5495315428418e+01, 0.2526661704812e+03,
6362 
6363           0.9015946748003e-10, 0.2236989966505e+01, 0.4171445043968e+03 };
6364 
6365     /* Sun-to-Earth, T^0, Z */
6366       static final double e0z[] = {
6367           0.2796207639075e-05, 0.3198701560209e+01, 0.8433466158131e+02,
6368           0.1016042198142e-05, 0.5422360395913e+01, 0.5507553240374e+01,
6369           0.8044305033647e-06, 0.3880222866652e+01, 0.5223693906222e+01,
6370           0.4385347909274e-06, 0.3704369937468e+01, 0.2352866153506e+01,
6371           0.3186156414906e-06, 0.3999639363235e+01, 0.1577343543434e+01,
6372           0.2272412285792e-06, 0.3984738315952e+01, 0.1047747311755e+01,
6373           0.1645620103007e-06, 0.3565412516841e+01, 0.5856477690889e+01,
6374           0.1815836921166e-06, 0.4984507059020e+01, 0.6283075850446e+01,
6375           0.1447461676364e-06, 0.3702753570108e+01, 0.9437762937313e+01,
6376           0.1430760876382e-06, 0.3409658712357e+01, 0.1021328554739e+02,
6377 
6378           0.1120445753226e-06, 0.4829561570246e+01, 0.1414349524433e+02,
6379           0.1090232840797e-06, 0.2080729178066e+01, 0.6812766822558e+01,
6380           0.9715727346551e-07, 0.3476295881948e+01, 0.4694002934110e+01,
6381           0.1036267136217e-06, 0.4056639536648e+01, 0.7109288135493e+02,
6382           0.8752665271340e-07, 0.4448159519911e+01, 0.5753384878334e+01,
6383           0.8331864956004e-07, 0.4991704044208e+01, 0.7084896783808e+01,
6384           0.6901658670245e-07, 0.4325358994219e+01, 0.6275962395778e+01,
6385           0.9144536848998e-07, 0.1141826375363e+01, 0.6620890113188e+01,
6386           0.7205085037435e-07, 0.3624344170143e+01, 0.5296909721118e+00,
6387           0.7697874654176e-07, 0.5554257458998e+01, 0.1676215758509e+03,
6388 
6389           0.5197545738384e-07, 0.6251760961735e+01, 0.1807370494127e+02,
6390           0.5031345378608e-07, 0.2497341091913e+01, 0.4705732307012e+01,
6391           0.4527110205840e-07, 0.2335079920992e+01, 0.6309374173736e+01,
6392           0.4753355798089e-07, 0.7094148987474e+00, 0.5884926831456e+01,
6393           0.4296951977516e-07, 0.1101916352091e+01, 0.6681224869435e+01,
6394           0.3855341568387e-07, 0.1825495405486e+01, 0.5486777812467e+01,
6395           0.5253930970990e-07, 0.4424740687208e+01, 0.7860419393880e+01,
6396           0.4024630496471e-07, 0.5120498157053e+01, 0.1336797263425e+02,
6397           0.4061069791453e-07, 0.6029771435451e+01, 0.3930209696940e+01,
6398           0.3797883804205e-07, 0.4435193600836e+00, 0.3154687086868e+01,
6399 
6400           0.2933033225587e-07, 0.5124157356507e+01, 0.1059381944224e+01,
6401           0.3503000930426e-07, 0.5421830162065e+01, 0.6069776770667e+01,
6402           0.3670096214050e-07, 0.4582101667297e+01, 0.1219403291462e+02,
6403           0.2905609437008e-07, 0.1926566420072e+01, 0.1097707878456e+02,
6404           0.2466827821713e-07, 0.6090174539834e+00, 0.6496374930224e+01,
6405           0.2691647295332e-07, 0.1393432595077e+01, 0.2200391463820e+02,
6406           0.2150554667946e-07, 0.4308671715951e+01, 0.5643178611111e+01,
6407           0.2237481922680e-07, 0.8133968269414e+00, 0.8635942003952e+01,
6408           0.1817741038157e-07, 0.3755205127454e+01, 0.3340612434717e+01,
6409           0.2227820762132e-07, 0.2759558596664e+01, 0.1203646072878e+02,
6410 
6411           0.1944713772307e-07, 0.5699645869121e+01, 0.1179062909082e+02,
6412           0.1527340520662e-07, 0.1986749091746e+01, 0.3981490189893e+00,
6413           0.1577282574914e-07, 0.3205017217983e+01, 0.5088628793478e+01,
6414           0.1424738825424e-07, 0.6256747903666e+01, 0.2544314396739e+01,
6415           0.1616563121701e-07, 0.2601671259394e+00, 0.1729818233119e+02,
6416           0.1401210391692e-07, 0.4686939173506e+01, 0.7058598460518e+01,
6417           0.1488726974214e-07, 0.2815862451372e+01, 0.2593412433514e+02,
6418           0.1692626442388e-07, 0.4956894109797e+01, 0.1564752902480e+03,
6419           0.1123571582910e-07, 0.2381192697696e+01, 0.3738761453707e+01,
6420           0.9903308606317e-08, 0.4294851657684e+01, 0.9225539266174e+01,
6421 
6422           0.9174533187191e-08, 0.3075171510642e+01, 0.4164311961999e+01,
6423           0.8645985631457e-08, 0.5477534821633e+00, 0.8429241228195e+01,
6424          -0.1085876492688e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6425           0.9264309077815e-08, 0.5968571670097e+01, 0.7079373888424e+01,
6426           0.8243116984954e-08, 0.1489098777643e+01, 0.1044738781244e+02,
6427           0.8268102113708e-08, 0.3512977691983e+01, 0.1150676975667e+02,
6428           0.9043613988227e-08, 0.1290704408221e+00, 0.1101510648075e+02,
6429           0.7432912038789e-08, 0.1991086893337e+01, 0.2608790314060e+02,
6430           0.8586233727285e-08, 0.4238357924414e+01, 0.2986433403208e+02,
6431           0.7612230060131e-08, 0.2911090150166e+01, 0.4732030630302e+01,
6432 
6433           0.7097787751408e-08, 0.1908938392390e+01, 0.8031092209206e+01,
6434           0.7640237040175e-08, 0.6129219000168e+00, 0.7962980379786e+00,
6435           0.7070445688081e-08, 0.1380417036651e+01, 0.2146165377750e+01,
6436           0.7690770957702e-08, 0.1680504249084e+01, 0.2122839202813e+02,
6437           0.8051292542594e-08, 0.5127423484511e+01, 0.2942463415728e+01,
6438           0.5902709104515e-08, 0.2020274190917e+01, 0.7755226100720e+00,
6439           0.5134567496462e-08, 0.2606778676418e+01, 0.1256615170089e+02,
6440           0.5525802046102e-08, 0.1613011769663e+01, 0.8018209333619e+00,
6441           0.5880724784221e-08, 0.4604483417236e+01, 0.4690479774488e+01,
6442           0.5211699081370e-08, 0.5718964114193e+01, 0.8827390247185e+01,
6443 
6444           0.4891849573562e-08, 0.3689658932196e+01, 0.2132990797783e+00,
6445           0.5150246069997e-08, 0.4099769855122e+01, 0.6480980550449e+02,
6446           0.5102434319633e-08, 0.5660834602509e+01, 0.3379454372902e+02,
6447           0.5083405254252e-08, 0.9842221218974e+00, 0.4136910472696e+01,
6448           0.4206562585682e-08, 0.1341363634163e+00, 0.3128388763578e+01,
6449           0.4663249683579e-08, 0.8130132735866e+00, 0.5216580451554e+01,
6450           0.4099474416530e-08, 0.5791497770644e+01, 0.4265981595566e+00,
6451           0.4628251220767e-08, 0.1249802769331e+01, 0.1572083878776e+02,
6452           0.5024068728142e-08, 0.4795684802743e+01, 0.6290189305114e+01,
6453           0.5120234327758e-08, 0.3810420387208e+01, 0.5230807360890e+01,
6454 
6455           0.5524029815280e-08, 0.1029264714351e+01, 0.2397622045175e+03,
6456           0.4757415718860e-08, 0.3528044781779e+01, 0.1649636139783e+02,
6457           0.3915786131127e-08, 0.5593889282646e+01, 0.1589072916335e+01,
6458           0.4869053149991e-08, 0.3299636454433e+01, 0.7632943190217e+01,
6459           0.3649365703729e-08, 0.1286049002584e+01, 0.6206810014183e+01,
6460           0.3992493949002e-08, 0.3100307589464e+01, 0.2515860172507e+02,
6461           0.3320247477418e-08, 0.6212683940807e+01, 0.1216800268190e+02,
6462           0.3287123739696e-08, 0.4699118445928e+01, 0.7234794171227e+01,
6463           0.3472776811103e-08, 0.2630507142004e+01, 0.7342457794669e+01,
6464           0.3423253294767e-08, 0.2946432844305e+01, 0.9623688285163e+01,
6465 
6466           0.3896173898244e-08, 0.1224834179264e+01, 0.6438496133249e+01,
6467           0.3388455337924e-08, 0.1543807616351e+01, 0.1494531617769e+02,
6468           0.3062704716523e-08, 0.1191777572310e+01, 0.8662240327241e+01,
6469           0.3270075600400e-08, 0.5483498767737e+01, 0.1194447056968e+01,
6470           0.3101209215259e-08, 0.8000833804348e+00, 0.3772475342596e+02,
6471           0.2780883347311e-08, 0.4077980721888e+00, 0.5863591145557e+01,
6472           0.2903605931824e-08, 0.2617490302147e+01, 0.1965104848470e+02,
6473           0.2682014743119e-08, 0.2634703158290e+01, 0.7238675589263e+01,
6474           0.2534360108492e-08, 0.6102446114873e+01, 0.6836645152238e+01,
6475           0.2392564882509e-08, 0.3681820208691e+01, 0.5849364236221e+01,
6476 
6477           0.2656667254856e-08, 0.6216045388886e+01, 0.6133512519065e+01,
6478           0.2331242096773e-08, 0.5864949777744e+01, 0.4535059491685e+01,
6479           0.2287898363668e-08, 0.4566628532802e+01, 0.7477522907414e+01,
6480           0.2336944521306e-08, 0.2442722126930e+01, 0.1137170464392e+02,
6481           0.3156632236269e-08, 0.1626628050682e+01, 0.2509084901204e+03,
6482           0.2982612402766e-08, 0.2803604512609e+01, 0.1748016358760e+01,
6483           0.2774031674807e-08, 0.4654002897158e+01, 0.8223916695780e+02,
6484           0.2295236548638e-08, 0.4326518333253e+01, 0.3378142627421e+00,
6485           0.2190714699873e-08, 0.4519614578328e+01, 0.2908881142201e+02,
6486           0.2191495845045e-08, 0.3012626912549e+01, 0.1673046366289e+02,
6487 
6488           0.2492901628386e-08, 0.1290101424052e+00, 0.1543797956245e+03,
6489           0.1993778064319e-08, 0.3864046799414e+01, 0.1778984560711e+02,
6490           0.1898146479022e-08, 0.5053777235891e+01, 0.2042657109477e+02,
6491           0.1918280127634e-08, 0.2222470192548e+01, 0.4165496312290e+02,
6492           0.1916351061607e-08, 0.8719067257774e+00, 0.7737595720538e+02,
6493           0.1834720181466e-08, 0.4031491098040e+01, 0.2358125818164e+02,
6494           0.1249201523806e-08, 0.5938379466835e+01, 0.3301902111895e+02,
6495           0.1477304050539e-08, 0.6544722606797e+00, 0.9548094718417e+02,
6496           0.1264316431249e-08, 0.2059072853236e+01, 0.8399684731857e+02,
6497           0.1203526495039e-08, 0.3644813532605e+01, 0.4558517281984e+02,
6498 
6499           0.9221681059831e-09, 0.3241815055602e+01, 0.7805158573086e+02,
6500           0.7849278367646e-09, 0.5043812342457e+01, 0.5217580628120e+02,
6501           0.7983392077387e-09, 0.5000024502753e+01, 0.1501922143975e+03,
6502           0.7925395431654e-09, 0.1398734871821e-01, 0.9061773743175e+02,
6503           0.7640473285886e-09, 0.5067111723130e+01, 0.4951538251678e+02,
6504           0.5398937754482e-09, 0.5597382200075e+01, 0.1613385000004e+03,
6505           0.5626247550193e-09, 0.2601338209422e+01, 0.7318837597844e+02,
6506           0.5525197197855e-09, 0.5814832109256e+01, 0.1432335100216e+03,
6507           0.5407629837898e-09, 0.3384820609076e+01, 0.3230491187871e+03,
6508           0.3856739119801e-09, 0.1072391840473e+01, 0.2334791286671e+03,
6509 
6510           0.3856425239987e-09, 0.2369540393327e+01, 0.1739046517013e+03,
6511           0.4350867755983e-09, 0.5255575751082e+01, 0.1620484330494e+03,
6512           0.3844113924996e-09, 0.5482356246182e+01, 0.9757644180768e+02,
6513           0.2854869155431e-09, 0.9573634763143e+00, 0.1697170704744e+03,
6514           0.1719227671416e-09, 0.1887203025202e+01, 0.2265204242912e+03,
6515           0.1527846879755e-09, 0.3982183931157e+01, 0.3341954043900e+03,
6516           0.1128229264847e-09, 0.2787457156298e+01, 0.3119028331842e+03 };
6517 
6518     /* Sun-to-Earth, T^1, X */
6519       static final double e1x[] = {
6520           0.1234046326004e-05, 0.0000000000000e+00, 0.0000000000000e+00,
6521           0.5150068824701e-06, 0.6002664557501e+01, 0.1256615170089e+02,
6522           0.1290743923245e-07, 0.5959437664199e+01, 0.1884922755134e+02,
6523           0.1068615564952e-07, 0.2015529654209e+01, 0.6283075850446e+01,
6524           0.2079619142538e-08, 0.1732960531432e+01, 0.6279552690824e+01,
6525           0.2078009243969e-08, 0.4915604476996e+01, 0.6286599010068e+01,
6526           0.6206330058856e-09, 0.3616457953824e+00, 0.4705732307012e+01,
6527           0.5989335313746e-09, 0.3802607304474e+01, 0.6256777527156e+01,
6528           0.5958495663840e-09, 0.2845866560031e+01, 0.6309374173736e+01,
6529           0.4866923261539e-09, 0.5213203771824e+01, 0.7755226100720e+00,
6530 
6531           0.4267785823142e-09, 0.4368189727818e+00, 0.1059381944224e+01,
6532           0.4610675141648e-09, 0.1837249181372e-01, 0.7860419393880e+01,
6533           0.3626989993973e-09, 0.2161590545326e+01, 0.5753384878334e+01,
6534           0.3563071194389e-09, 0.1452631954746e+01, 0.5884926831456e+01,
6535           0.3557015642807e-09, 0.4470593393054e+01, 0.6812766822558e+01,
6536           0.3210412089122e-09, 0.5195926078314e+01, 0.6681224869435e+01,
6537           0.2875473577986e-09, 0.5916256610193e+01, 0.2513230340178e+02,
6538           0.2842913681629e-09, 0.1149902426047e+01, 0.6127655567643e+01,
6539           0.2751248215916e-09, 0.5502088574662e+01, 0.6438496133249e+01,
6540           0.2481432881127e-09, 0.2921989846637e+01, 0.5486777812467e+01,
6541 
6542           0.2059885976560e-09, 0.3718070376585e+01, 0.7079373888424e+01,
6543           0.2015522342591e-09, 0.5979395259740e+01, 0.6290189305114e+01,
6544           0.1995364084253e-09, 0.6772087985494e+00, 0.6275962395778e+01,
6545           0.1957436436943e-09, 0.2899210654665e+01, 0.5507553240374e+01,
6546           0.1651609818948e-09, 0.6228206482192e+01, 0.1150676975667e+02,
6547           0.1822980550699e-09, 0.1469348746179e+01, 0.1179062909082e+02,
6548           0.1675223159760e-09, 0.3813910555688e+01, 0.7058598460518e+01,
6549           0.1706491764745e-09, 0.3004380506684e+00, 0.7113454667900e-02,
6550           0.1392952362615e-09, 0.1440393973406e+01, 0.7962980379786e+00,
6551           0.1209868266342e-09, 0.4150425791727e+01, 0.4694002934110e+01,
6552 
6553           0.1009827202611e-09, 0.3290040429843e+01, 0.3738761453707e+01,
6554           0.1047261388602e-09, 0.4229590090227e+01, 0.6282095334605e+01,
6555           0.1047006652004e-09, 0.2418967680575e+01, 0.6284056366286e+01,
6556           0.9609993143095e-10, 0.4627943659201e+01, 0.6069776770667e+01,
6557           0.9590900593873e-10, 0.1894393939924e+01, 0.4136910472696e+01,
6558           0.9146249188071e-10, 0.2010647519562e+01, 0.6496374930224e+01,
6559           0.8545274480290e-10, 0.5529846956226e-01, 0.1194447056968e+01,
6560           0.8224377881194e-10, 0.1254304102174e+01, 0.1589072916335e+01,
6561           0.6183529510410e-10, 0.3360862168815e+01, 0.8827390247185e+01,
6562           0.6259255147141e-10, 0.4755628243179e+01, 0.8429241228195e+01,
6563 
6564           0.5539291694151e-10, 0.5371746955142e+01, 0.4933208510675e+01,
6565           0.7328259466314e-10, 0.4927699613906e+00, 0.4535059491685e+01,
6566           0.6017835843560e-10, 0.5776682001734e-01, 0.1255903824622e+02,
6567           0.7079827775243e-10, 0.4395059432251e+01, 0.5088628793478e+01,
6568           0.5170358878213e-10, 0.5154062619954e+01, 0.1176985366291e+02,
6569           0.4872301838682e-10, 0.6289611648973e+00, 0.6040347114260e+01,
6570           0.5249869411058e-10, 0.5617272046949e+01, 0.3154687086868e+01,
6571           0.4716172354411e-10, 0.3965901800877e+01, 0.5331357529664e+01,
6572           0.4871214940964e-10, 0.4627507050093e+01, 0.1256967486051e+02,
6573           0.4598076850751e-10, 0.6023631226459e+01, 0.6525804586632e+01,
6574 
6575           0.4562196089485e-10, 0.4138562084068e+01, 0.3930209696940e+01,
6576           0.4325493872224e-10, 0.1330845906564e+01, 0.7632943190217e+01,
6577           0.5673781176748e-10, 0.2558752615657e+01, 0.5729506548653e+01,
6578           0.3961436642503e-10, 0.2728071734630e+01, 0.7234794171227e+01,
6579           0.5101868209058e-10, 0.4113444965144e+01, 0.6836645152238e+01,
6580           0.5257043167676e-10, 0.6195089830590e+01, 0.8031092209206e+01,
6581           0.5076613989393e-10, 0.2305124132918e+01, 0.7477522907414e+01,
6582           0.3342169352778e-10, 0.5415998155071e+01, 0.1097707878456e+02,
6583           0.3545881983591e-10, 0.3727160564574e+01, 0.4164311961999e+01,
6584           0.3364063738599e-10, 0.2901121049204e+00, 0.1137170464392e+02,
6585 
6586           0.3357039670776e-10, 0.1652229354331e+01, 0.5223693906222e+01,
6587           0.4307412268687e-10, 0.4938909587445e+01, 0.1592596075957e+01,
6588           0.3405769115435e-10, 0.2408890766511e+01, 0.3128388763578e+01,
6589           0.3001926198480e-10, 0.4862239006386e+01, 0.1748016358760e+01,
6590           0.2778264787325e-10, 0.5241168661353e+01, 0.7342457794669e+01,
6591           0.2676159480666e-10, 0.3423593942199e+01, 0.2146165377750e+01,
6592           0.2954273399939e-10, 0.1881721265406e+01, 0.5368044267797e+00,
6593           0.3309362888795e-10, 0.1931525677349e+01, 0.8018209333619e+00,
6594           0.2810283608438e-10, 0.2414659495050e+01, 0.5225775174439e+00,
6595           0.3378045637764e-10, 0.4238019163430e+01, 0.1554202828031e+00,
6596 
6597           0.2558134979840e-10, 0.1828225235805e+01, 0.5230807360890e+01,
6598           0.2273755578447e-10, 0.5858184283998e+01, 0.7084896783808e+01,
6599           0.2294176037690e-10, 0.4514589779057e+01, 0.1726015463500e+02,
6600           0.2533506099435e-10, 0.2355717851551e+01, 0.5216580451554e+01,
6601           0.2716685375812e-10, 0.2221003625100e+01, 0.8635942003952e+01,
6602           0.2419043435198e-10, 0.5955704951635e+01, 0.4690479774488e+01,
6603           0.2521232544812e-10, 0.1395676848521e+01, 0.5481254917084e+01,
6604           0.2630195021491e-10, 0.5727468918743e+01, 0.2629832328990e-01,
6605           0.2548395840944e-10, 0.2628351859400e-03, 0.1349867339771e+01 };
6606 
6607     /* Sun-to-Earth, T^1, Y */
6608       static final double e1y[] = {
6609           0.9304690546528e-06, 0.0000000000000e+00, 0.0000000000000e+00,
6610           0.5150715570663e-06, 0.4431807116294e+01, 0.1256615170089e+02,
6611           0.1290825411056e-07, 0.4388610039678e+01, 0.1884922755134e+02,
6612           0.4645466665386e-08, 0.5827263376034e+01, 0.6283075850446e+01,
6613           0.2079625310718e-08, 0.1621698662282e+00, 0.6279552690824e+01,
6614           0.2078189850907e-08, 0.3344713435140e+01, 0.6286599010068e+01,
6615           0.6207190138027e-09, 0.5074049319576e+01, 0.4705732307012e+01,
6616           0.5989826532569e-09, 0.2231842216620e+01, 0.6256777527156e+01,
6617           0.5961360812618e-09, 0.1274975769045e+01, 0.6309374173736e+01,
6618           0.4874165471016e-09, 0.3642277426779e+01, 0.7755226100720e+00,
6619 
6620           0.4283834034360e-09, 0.5148765510106e+01, 0.1059381944224e+01,
6621           0.4652389287529e-09, 0.4715794792175e+01, 0.7860419393880e+01,
6622           0.3751707476401e-09, 0.6617207370325e+00, 0.5753384878334e+01,
6623           0.3559998806198e-09, 0.6155548875404e+01, 0.5884926831456e+01,
6624           0.3558447558857e-09, 0.2898827297664e+01, 0.6812766822558e+01,
6625           0.3211116927106e-09, 0.3625813502509e+01, 0.6681224869435e+01,
6626           0.2875609914672e-09, 0.4345435813134e+01, 0.2513230340178e+02,
6627           0.2843109704069e-09, 0.5862263940038e+01, 0.6127655567643e+01,
6628           0.2744676468427e-09, 0.3926419475089e+01, 0.6438496133249e+01,
6629           0.2481285237789e-09, 0.1351976572828e+01, 0.5486777812467e+01,
6630 
6631           0.2060338481033e-09, 0.2147556998591e+01, 0.7079373888424e+01,
6632           0.2015822358331e-09, 0.4408358972216e+01, 0.6290189305114e+01,
6633           0.2001195944195e-09, 0.5385829822531e+01, 0.6275962395778e+01,
6634           0.1953667642377e-09, 0.1304933746120e+01, 0.5507553240374e+01,
6635           0.1839744078713e-09, 0.6173567228835e+01, 0.1179062909082e+02,
6636           0.1643334294845e-09, 0.4635942997523e+01, 0.1150676975667e+02,
6637           0.1768051018652e-09, 0.5086283558874e+01, 0.7113454667900e-02,
6638           0.1674874205489e-09, 0.2243332137241e+01, 0.7058598460518e+01,
6639           0.1421445397609e-09, 0.6186899771515e+01, 0.7962980379786e+00,
6640           0.1255163958267e-09, 0.5730238465658e+01, 0.4694002934110e+01,
6641 
6642           0.1013945281961e-09, 0.1726055228402e+01, 0.3738761453707e+01,
6643           0.1047294335852e-09, 0.2658801228129e+01, 0.6282095334605e+01,
6644           0.1047103879392e-09, 0.8481047835035e+00, 0.6284056366286e+01,
6645           0.9530343962826e-10, 0.3079267149859e+01, 0.6069776770667e+01,
6646           0.9604637611690e-10, 0.3258679792918e+00, 0.4136910472696e+01,
6647           0.9153518537177e-10, 0.4398599886584e+00, 0.6496374930224e+01,
6648           0.8562458214922e-10, 0.4772686794145e+01, 0.1194447056968e+01,
6649           0.8232525360654e-10, 0.5966220721679e+01, 0.1589072916335e+01,
6650           0.6150223411438e-10, 0.1780985591923e+01, 0.8827390247185e+01,
6651           0.6272087858000e-10, 0.3184305429012e+01, 0.8429241228195e+01,
6652 
6653           0.5540476311040e-10, 0.3801260595433e+01, 0.4933208510675e+01,
6654           0.7331901699361e-10, 0.5205948591865e+01, 0.4535059491685e+01,
6655           0.6018528702791e-10, 0.4770139083623e+01, 0.1255903824622e+02,
6656           0.5150530724804e-10, 0.3574796899585e+01, 0.1176985366291e+02,
6657           0.6471933741811e-10, 0.2679787266521e+01, 0.5088628793478e+01,
6658           0.5317460644174e-10, 0.9528763345494e+00, 0.3154687086868e+01,
6659           0.4832187748783e-10, 0.5329322498232e+01, 0.6040347114260e+01,
6660           0.4716763555110e-10, 0.2395235316466e+01, 0.5331357529664e+01,
6661           0.4871509139861e-10, 0.3056663648823e+01, 0.1256967486051e+02,
6662           0.4598417696768e-10, 0.4452762609019e+01, 0.6525804586632e+01,
6663 
6664           0.5674189533175e-10, 0.9879680872193e+00, 0.5729506548653e+01,
6665           0.4073560328195e-10, 0.5939127696986e+01, 0.7632943190217e+01,
6666           0.5040994945359e-10, 0.4549875824510e+01, 0.8031092209206e+01,
6667           0.5078185134679e-10, 0.7346659893982e+00, 0.7477522907414e+01,
6668           0.3769343537061e-10, 0.1071317188367e+01, 0.7234794171227e+01,
6669           0.4980331365299e-10, 0.2500345341784e+01, 0.6836645152238e+01,
6670           0.3458236594757e-10, 0.3825159450711e+01, 0.1097707878456e+02,
6671           0.3578859493602e-10, 0.5299664791549e+01, 0.4164311961999e+01,
6672           0.3370504646419e-10, 0.5002316301593e+01, 0.1137170464392e+02,
6673           0.3299873338428e-10, 0.2526123275282e+01, 0.3930209696940e+01,
6674 
6675           0.4304917318409e-10, 0.3368078557132e+01, 0.1592596075957e+01,
6676           0.3402418753455e-10, 0.8385495425800e+00, 0.3128388763578e+01,
6677           0.2778460572146e-10, 0.3669905203240e+01, 0.7342457794669e+01,
6678           0.2782710128902e-10, 0.2691664812170e+00, 0.1748016358760e+01,
6679           0.2711725179646e-10, 0.4707487217718e+01, 0.5296909721118e+00,
6680           0.2981760946340e-10, 0.3190260867816e+00, 0.5368044267797e+00,
6681           0.2811672977772e-10, 0.3196532315372e+01, 0.7084896783808e+01,
6682           0.2863454474467e-10, 0.2263240324780e+00, 0.5223693906222e+01,
6683           0.3333464634051e-10, 0.3498451685065e+01, 0.8018209333619e+00,
6684           0.3312991747609e-10, 0.5839154477412e+01, 0.1554202828031e+00,
6685 
6686           0.2813255564006e-10, 0.8268044346621e+00, 0.5225775174439e+00,
6687           0.2665098083966e-10, 0.3934021725360e+01, 0.5216580451554e+01,
6688           0.2349795705216e-10, 0.5197620913779e+01, 0.2146165377750e+01,
6689           0.2330352293961e-10, 0.2984999231807e+01, 0.1726015463500e+02,
6690           0.2728001683419e-10, 0.6521679638544e+00, 0.8635942003952e+01,
6691           0.2484061007669e-10, 0.3468955561097e+01, 0.5230807360890e+01,
6692           0.2646328768427e-10, 0.1013724533516e+01, 0.2629832328990e-01,
6693           0.2518630264831e-10, 0.6108081057122e+01, 0.5481254917084e+01,
6694           0.2421901455384e-10, 0.1651097776260e+01, 0.1349867339771e+01,
6695           0.6348533267831e-11, 0.3220226560321e+01, 0.8433466158131e+02 };
6696 
6697     /* Sun-to-Earth, T^1, Z */
6698       static final double e1z[] = {
6699           0.2278290449966e-05, 0.3413716033863e+01, 0.6283075850446e+01,
6700           0.5429458209830e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6701           0.1903240492525e-07, 0.3370592358297e+01, 0.1256615170089e+02,
6702           0.2385409276743e-09, 0.3327914718416e+01, 0.1884922755134e+02,
6703           0.8676928342573e-10, 0.1824006811264e+01, 0.5223693906222e+01,
6704           0.7765442593544e-10, 0.3888564279247e+01, 0.5507553240374e+01,
6705           0.7066158332715e-10, 0.5194267231944e+01, 0.2352866153506e+01,
6706           0.7092175288657e-10, 0.2333246960021e+01, 0.8399684731857e+02,
6707           0.5357582213535e-10, 0.2224031176619e+01, 0.5296909721118e+00,
6708           0.3828035865021e-10, 0.2156710933584e+01, 0.6279552690824e+01,
6709 
6710           0.3824857220427e-10, 0.1529755219915e+01, 0.6286599010068e+01,
6711           0.3286995181628e-10, 0.4879512900483e+01, 0.1021328554739e+02 };
6712 
6713     /* Sun-to-Earth, T^2, X */
6714       static final double e2x[] = {
6715          -0.4143818297913e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6716           0.2171497694435e-10, 0.4398225628264e+01, 0.1256615170089e+02,
6717           0.9845398442516e-11, 0.2079720838384e+00, 0.6283075850446e+01,
6718           0.9256833552682e-12, 0.4191264694361e+01, 0.1884922755134e+02,
6719           0.1022049384115e-12, 0.5381133195658e+01, 0.8399684731857e+02 };
6720 
6721     /* Sun-to-Earth, T^2, Y */
6722       static final double e2y[] = {
6723           0.5063375872532e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6724           0.2173815785980e-10, 0.2827805833053e+01, 0.1256615170089e+02,
6725           0.1010231999920e-10, 0.4634612377133e+01, 0.6283075850446e+01,
6726           0.9259745317636e-12, 0.2620612076189e+01, 0.1884922755134e+02,
6727           0.1022202095812e-12, 0.3809562326066e+01, 0.8399684731857e+02 };
6728 
6729     /* Sun-to-Earth, T^2, Z */
6730       static final double e2z[] = {
6731           0.9722666114891e-10, 0.5152219582658e+01, 0.6283075850446e+01,
6732          -0.3494819171909e-11, 0.0000000000000e+00, 0.0000000000000e+00,
6733           0.6713034376076e-12, 0.6440188750495e+00, 0.1256615170089e+02 };
6734 
6735     }
6736       //subclassed the 
6737       private static class SSB {
6738     /* SSB-to-Sun, T^0, X */
6739       static final double s0x[] = {
6740           0.4956757536410e-02, 0.3741073751789e+01, 0.5296909721118e+00,
6741           0.2718490072522e-02, 0.4016011511425e+01, 0.2132990797783e+00,
6742           0.1546493974344e-02, 0.2170528330642e+01, 0.3813291813120e-01,
6743           0.8366855276341e-03, 0.2339614075294e+01, 0.7478166569050e-01,
6744           0.2936777942117e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6745           0.1201317439469e-03, 0.4090736353305e+01, 0.1059381944224e+01,
6746           0.7578550887230e-04, 0.3241518088140e+01, 0.4265981595566e+00,
6747           0.1941787367773e-04, 0.1012202064330e+01, 0.2061856251104e+00,
6748           0.1889227765991e-04, 0.3892520416440e+01, 0.2204125344462e+00,
6749           0.1937896968613e-04, 0.4797779441161e+01, 0.1495633313810e+00,
6750 
6751           0.1434506110873e-04, 0.3868960697933e+01, 0.5225775174439e+00,
6752           0.1406659911580e-04, 0.4759766557397e+00, 0.5368044267797e+00,
6753           0.1179022300202e-04, 0.7774961520598e+00, 0.7626583626240e-01,
6754           0.8085864460959e-05, 0.3254654471465e+01, 0.3664874755930e-01,
6755           0.7622752967615e-05, 0.4227633103489e+01, 0.3961708870310e-01,
6756           0.6209171139066e-05, 0.2791828325711e+00, 0.7329749511860e-01,
6757           0.4366435633970e-05, 0.4440454875925e+01, 0.1589072916335e+01,
6758           0.3792124889348e-05, 0.5156393842356e+01, 0.7113454667900e-02,
6759           0.3154548963402e-05, 0.6157005730093e+01, 0.4194847048887e+00,
6760           0.3088359882942e-05, 0.2494567553163e+01, 0.6398972393349e+00,
6761 
6762           0.2788440902136e-05, 0.4934318747989e+01, 0.1102062672231e+00,
6763           0.3039928456376e-05, 0.4895077702640e+01, 0.6283075850446e+01,
6764           0.2272258457679e-05, 0.5278394064764e+01, 0.1030928125552e+00,
6765           0.2162007057957e-05, 0.5802978019099e+01, 0.3163918923335e+00,
6766           0.1767632855737e-05, 0.3415346595193e-01, 0.1021328554739e+02,
6767           0.1349413459362e-05, 0.2001643230755e+01, 0.1484170571900e-02,
6768           0.1170141900476e-05, 0.2424750491620e+01, 0.6327837846670e+00,
6769           0.1054355266820e-05, 0.3123311487576e+01, 0.4337116142245e+00,
6770           0.9800822461610e-06, 0.3026258088130e+01, 0.1052268489556e+01,
6771           0.1091203749931e-05, 0.3157811670347e+01, 0.1162474756779e+01,
6772 
6773           0.6960236715913e-06, 0.8219570542313e+00, 0.1066495398892e+01,
6774           0.5689257296909e-06, 0.1323052375236e+01, 0.9491756770005e+00,
6775           0.6613172135802e-06, 0.2765348881598e+00, 0.8460828644453e+00,
6776           0.6277702517571e-06, 0.5794064466382e+01, 0.1480791608091e+00,
6777           0.6304884066699e-06, 0.7323555380787e+00, 0.2243449970715e+00,
6778           0.4897850467382e-06, 0.3062464235399e+01, 0.3340612434717e+01,
6779           0.3759148598786e-06, 0.4588290469664e+01, 0.3516457698740e-01,
6780           0.3110520548195e-06, 0.1374299536572e+01, 0.6373574839730e-01,
6781           0.3064708359780e-06, 0.4222267485047e+01, 0.1104591729320e-01,
6782           0.2856347168241e-06, 0.3714202944973e+01, 0.1510475019529e+00,
6783 
6784           0.2840945514288e-06, 0.2847972875882e+01, 0.4110125927500e-01,
6785           0.2378951599405e-06, 0.3762072563388e+01, 0.2275259891141e+00,
6786           0.2714229481417e-06, 0.1036049980031e+01, 0.2535050500000e-01,
6787           0.2323551717307e-06, 0.4682388599076e+00, 0.8582758298370e-01,
6788           0.1881790512219e-06, 0.4790565425418e+01, 0.2118763888447e+01,
6789           0.2261353968371e-06, 0.1669144912212e+01, 0.7181332454670e-01,
6790           0.2214546389848e-06, 0.3937717281614e+01, 0.2968341143800e-02,
6791           0.2184915594933e-06, 0.1129169845099e+00, 0.7775000683430e-01,
6792           0.2000164937936e-06, 0.4030009638488e+01, 0.2093666171530e+00,
6793           0.1966105136719e-06, 0.8745955786834e+00, 0.2172315424036e+00,
6794 
6795           0.1904742332624e-06, 0.5919743598964e+01, 0.2022531624851e+00,
6796           0.1657399705031e-06, 0.2549141484884e+01, 0.7358765972222e+00,
6797           0.1574070533987e-06, 0.5277533020230e+01, 0.7429900518901e+00,
6798           0.1832261651039e-06, 0.3064688127777e+01, 0.3235053470014e+00,
6799           0.1733615346569e-06, 0.3011432799094e+01, 0.1385174140878e+00,
6800           0.1549124014496e-06, 0.4005569132359e+01, 0.5154640627760e+00,
6801           0.1637044713838e-06, 0.1831375966632e+01, 0.8531963191132e+00,
6802           0.1123420082383e-06, 0.1180270407578e+01, 0.1990721704425e+00,
6803           0.1083754165740e-06, 0.3414101320863e+00, 0.5439178814476e+00,
6804           0.1156638012655e-06, 0.6130479452594e+00, 0.5257585094865e+00,
6805 
6806           0.1142548785134e-06, 0.3724761948846e+01, 0.5336234347371e+00,
6807           0.7921463895965e-07, 0.2435425589361e+01, 0.1478866649112e+01,
6808           0.7428600285231e-07, 0.3542144398753e+01, 0.2164800718209e+00,
6809           0.8323211246747e-07, 0.3525058072354e+01, 0.1692165728891e+01,
6810           0.7257595116312e-07, 0.1364299431982e+01, 0.2101180877357e+00,
6811           0.7111185833236e-07, 0.2460478875808e+01, 0.4155522422634e+00,
6812           0.6868090383716e-07, 0.4397327670704e+01, 0.1173197218910e+00,
6813           0.7226419974175e-07, 0.4042647308905e+01, 0.1265567569334e+01,
6814           0.6955642383177e-07, 0.2865047906085e+01, 0.9562891316684e+00,
6815           0.7492139296331e-07, 0.5014278994215e+01, 0.1422690933580e-01,
6816 
6817           0.6598363128857e-07, 0.2376730020492e+01, 0.6470106940028e+00,
6818           0.7381147293385e-07, 0.3272990384244e+01, 0.1581959461667e+01,
6819           0.6402909624032e-07, 0.5302290955138e+01, 0.9597935788730e-01,
6820           0.6237454263857e-07, 0.5444144425332e+01, 0.7084920306520e-01,
6821           0.5241198544016e-07, 0.4215359579205e+01, 0.5265099800692e+00,
6822           0.5144463853918e-07, 0.1218916689916e+00, 0.5328719641544e+00,
6823           0.5868164772299e-07, 0.2369402002213e+01, 0.7871412831580e-01,
6824           0.6233195669151e-07, 0.1254922242403e+01, 0.2608790314060e+02,
6825           0.6068463791422e-07, 0.5679713760431e+01, 0.1114304132498e+00,
6826           0.4359361135065e-07, 0.6097219641646e+00, 0.1375773836557e+01,
6827 
6828           0.4686510366826e-07, 0.4786231041431e+01, 0.1143987543936e+00,
6829           0.3758977287225e-07, 0.1167368068139e+01, 0.1596186371003e+01,
6830           0.4282051974778e-07, 0.1519471064319e+01, 0.2770348281756e+00,
6831           0.5153765386113e-07, 0.1860532322984e+01, 0.2228608264996e+00,
6832           0.4575129387188e-07, 0.7632857887158e+00, 0.1465949902372e+00,
6833           0.3326844933286e-07, 0.1298219485285e+01, 0.5070101000000e-01,
6834           0.3748617450984e-07, 0.1046510321062e+01, 0.4903339079539e+00,
6835           0.2816756661499e-07, 0.3434522346190e+01, 0.2991266627620e+00,
6836           0.3412750405039e-07, 0.2523766270318e+01, 0.3518164938661e+00,
6837           0.2655796761776e-07, 0.2904422260194e+01, 0.6256703299991e+00,
6838 
6839           0.2963597929458e-07, 0.5923900431149e+00, 0.1099462426779e+00,
6840           0.2539523734781e-07, 0.4851947722567e+01, 0.1256615170089e+02,
6841           0.2283087914139e-07, 0.3400498595496e+01, 0.6681224869435e+01,
6842           0.2321309799331e-07, 0.5789099148673e+01, 0.3368040641550e-01,
6843           0.2549657649750e-07, 0.3991856479792e-01, 0.1169588211447e+01,
6844           0.2290462303977e-07, 0.2788567577052e+01, 0.1045155034888e+01,
6845           0.1945398522914e-07, 0.3290896998176e+01, 0.1155361302111e+01,
6846           0.1849171512638e-07, 0.2698060129367e+01, 0.4452511715700e-02,
6847           0.1647199834254e-07, 0.3016735644085e+01, 0.4408250688924e+00,
6848           0.1529530765273e-07, 0.5573043116178e+01, 0.6521991896920e-01,
6849 
6850           0.1433199339978e-07, 0.1481192356147e+01, 0.9420622223326e+00,
6851           0.1729134193602e-07, 0.1422817538933e+01, 0.2108507877249e+00,
6852           0.1716463931346e-07, 0.3469468901855e+01, 0.2157473718317e+00,
6853           0.1391206061378e-07, 0.6122436220547e+01, 0.4123712502208e+00,
6854           0.1404746661924e-07, 0.1647765641936e+01, 0.4258542984690e-01,
6855           0.1410452399455e-07, 0.5989729161964e+01, 0.2258291676434e+00,
6856           0.1089828772168e-07, 0.2833705509371e+01, 0.4226656969313e+00,
6857           0.1047374564948e-07, 0.5090690007331e+00, 0.3092784376656e+00,
6858           0.1358279126532e-07, 0.5128990262836e+01, 0.7923417740620e-01,
6859           0.1020456476148e-07, 0.9632772880808e+00, 0.1456308687557e+00,
6860 
6861           0.1033428735328e-07, 0.3223779318418e+01, 0.1795258541446e+01,
6862           0.1412435841540e-07, 0.2410271572721e+01, 0.1525316725248e+00,
6863           0.9722759371574e-08, 0.2333531395690e+01, 0.8434341241180e-01,
6864           0.9657334084704e-08, 0.6199270974168e+01, 0.1272681024002e+01,
6865           0.1083641148690e-07, 0.2864222292929e+01, 0.7032915397480e-01,
6866           0.1067318403838e-07, 0.5833458866568e+00, 0.2123349582968e+00,
6867           0.1062366201976e-07, 0.4307753989494e+01, 0.2142632012598e+00,
6868           0.1236364149266e-07, 0.2873917870593e+01, 0.1847279083684e+00,
6869           0.1092759489593e-07, 0.2959887266733e+01, 0.1370332435159e+00,
6870           0.8912069362899e-08, 0.5141213702562e+01, 0.2648454860559e+01,
6871 
6872           0.9656467707970e-08, 0.4532182462323e+01, 0.4376440768498e+00,
6873           0.8098386150135e-08, 0.2268906338379e+01, 0.2880807454688e+00,
6874           0.7857714675000e-08, 0.4055544260745e+01, 0.2037373330570e+00,
6875           0.7288455940646e-08, 0.5357901655142e+01, 0.1129145838217e+00,
6876           0.9450595950552e-08, 0.4264926963939e+01, 0.5272426800584e+00,
6877           0.9381718247537e-08, 0.7489366976576e-01, 0.5321392641652e+00,
6878           0.7079052646038e-08, 0.1923311052874e+01, 0.6288513220417e+00,
6879           0.9259004415344e-08, 0.2970256853438e+01, 0.1606092486742e+00,
6880           0.8259801499742e-08, 0.3327056314697e+01, 0.8389694097774e+00,
6881           0.6476334355779e-08, 0.2954925505727e+01, 0.2008557621224e+01,
6882 
6883           0.5984021492007e-08, 0.9138753105829e+00, 0.2042657109477e+02,
6884           0.5989546863181e-08, 0.3244464082031e+01, 0.2111650433779e+01,
6885           0.6233108606023e-08, 0.4995232638403e+00, 0.4305306221819e+00,
6886           0.6877299149965e-08, 0.2834987233449e+01, 0.9561746721300e-02,
6887           0.8311234227190e-08, 0.2202951835758e+01, 0.3801276407308e+00,
6888           0.6599472832414e-08, 0.4478581462618e+01, 0.1063314406849e+01,
6889           0.6160491096549e-08, 0.5145858696411e+01, 0.1368660381889e+01,
6890           0.6164772043891e-08, 0.3762976697911e+00, 0.4234171675140e+00,
6891           0.6363248684450e-08, 0.3162246718685e+01, 0.1253008786510e-01,
6892           0.6448587520999e-08, 0.3442693302119e+01, 0.5287268506303e+00,
6893 
6894           0.6431662283977e-08, 0.8977549136606e+00, 0.5306550935933e+00,
6895           0.6351223158474e-08, 0.4306447410369e+01, 0.5217580628120e+02,
6896           0.5476721393451e-08, 0.3888529177855e+01, 0.2221856701002e+01,
6897           0.5341772572619e-08, 0.2655560662512e+01, 0.7466759693650e-01,
6898           0.5337055758302e-08, 0.5164990735946e+01, 0.7489573444450e-01,
6899           0.5373120816787e-08, 0.6041214553456e+01, 0.1274714967946e+00,
6900           0.5392351705426e-08, 0.9177763485932e+00, 0.1055449481598e+01,
6901           0.6688495850205e-08, 0.3089608126937e+01, 0.2213766559277e+00,
6902           0.5072003660362e-08, 0.4311316541553e+01, 0.2132517061319e+00,
6903           0.5070726650455e-08, 0.5790675464444e+00, 0.2133464534247e+00,
6904 
6905           0.5658012950032e-08, 0.2703945510675e+01, 0.7287631425543e+00,
6906           0.4835509924854e-08, 0.2975422976065e+01, 0.7160067364790e-01,
6907           0.6479821978012e-08, 0.1324168733114e+01, 0.2209183458640e-01,
6908           0.6230636494980e-08, 0.2860103632836e+01, 0.3306188016693e+00,
6909           0.4649239516213e-08, 0.4832259763403e+01, 0.7796265773310e-01,
6910           0.6487325792700e-08, 0.2726165825042e+01, 0.3884652414254e+00,
6911           0.4682823682770e-08, 0.6966602455408e+00, 0.1073608853559e+01,
6912           0.5704230804976e-08, 0.5669634104606e+01, 0.8731175355560e-01,
6913           0.6125413585489e-08, 0.1513386538915e+01, 0.7605151500000e-01,
6914           0.6035825038187e-08, 0.1983509168227e+01, 0.9846002785331e+00,
6915 
6916           0.4331123462303e-08, 0.2782892992807e+01, 0.4297791515992e+00,
6917           0.4681107685143e-08, 0.5337232886836e+01, 0.2127790306879e+00,
6918           0.4669105829655e-08, 0.5837133792160e+01, 0.2138191288687e+00,
6919           0.5138823602365e-08, 0.3080560200507e+01, 0.7233337363710e-01,
6920           0.4615856664534e-08, 0.1661747897471e+01, 0.8603097737811e+00,
6921           0.4496916702197e-08, 0.2112508027068e+01, 0.7381754420900e-01,
6922           0.4278479042945e-08, 0.5716528462627e+01, 0.7574578717200e-01,
6923           0.3840525503932e-08, 0.6424172726492e+00, 0.3407705765729e+00,
6924           0.4866636509685e-08, 0.4919244697715e+01, 0.7722995774390e-01,
6925           0.3526100639296e-08, 0.2550821052734e+01, 0.6225157782540e-01,
6926 
6927           0.3939558488075e-08, 0.3939331491710e+01, 0.5268983110410e-01,
6928           0.4041268772576e-08, 0.2275337571218e+01, 0.3503323232942e+00,
6929           0.3948761842853e-08, 0.1999324200790e+01, 0.1451108196653e+00,
6930           0.3258394550029e-08, 0.9121001378200e+00, 0.5296435984654e+00,
6931           0.3257897048761e-08, 0.3428428660869e+01, 0.5297383457582e+00,
6932           0.3842559031298e-08, 0.6132927720035e+01, 0.9098186128426e+00,
6933           0.3109920095448e-08, 0.7693650193003e+00, 0.3932462625300e-02,
6934           0.3132237775119e-08, 0.3621293854908e+01, 0.2346394437820e+00,
6935           0.3942189421510e-08, 0.4841863659733e+01, 0.3180992042600e-02,
6936           0.3796972285340e-08, 0.1814174994268e+01, 0.1862120789403e+00,
6937 
6938           0.3995640233688e-08, 0.1386990406091e+01, 0.4549093064213e+00,
6939           0.2875013727414e-08, 0.9178318587177e+00, 0.1905464808669e+01,
6940           0.3073719932844e-08, 0.2688923811835e+01, 0.3628624111593e+00,
6941           0.2731016580075e-08, 0.1188259127584e+01, 0.2131850110243e+00,
6942           0.2729549896546e-08, 0.3702160634273e+01, 0.2134131485323e+00,
6943           0.3339372892449e-08, 0.7199163960331e+00, 0.2007689919132e+00,
6944           0.2898833764204e-08, 0.1916709364999e+01, 0.5291709230214e+00,
6945           0.2894536549362e-08, 0.2424043195547e+01, 0.5302110212022e+00,
6946           0.3096872473843e-08, 0.4445894977497e+01, 0.2976424921901e+00,
6947           0.2635672326810e-08, 0.3814366984117e+01, 0.1485980103780e+01,
6948 
6949           0.3649302697001e-08, 0.2924200596084e+01, 0.6044726378023e+00,
6950           0.3127954585895e-08, 0.1842251648327e+01, 0.1084620721060e+00,
6951           0.2616040173947e-08, 0.4155841921984e+01, 0.1258454114666e+01,
6952           0.2597395859860e-08, 0.1158045978874e+00, 0.2103781122809e+00,
6953           0.2593286172210e-08, 0.4771850408691e+01, 0.2162200472757e+00,
6954           0.2481823585747e-08, 0.4608842558889e+00, 0.1062562936266e+01,
6955           0.2742219550725e-08, 0.1538781127028e+01, 0.5651155736444e+00,
6956           0.3199558469610e-08, 0.3226647822878e+00, 0.7036329877322e+00,
6957           0.2666088542957e-08, 0.1967991731219e+00, 0.1400015846597e+00,
6958           0.2397067430580e-08, 0.3707036669873e+01, 0.2125476091956e+00,
6959 
6960           0.2376570772738e-08, 0.1182086628042e+01, 0.2140505503610e+00,
6961           0.2547228007887e-08, 0.4906256820629e+01, 0.1534957940063e+00,
6962           0.2265575594114e-08, 0.3414949866857e+01, 0.2235935264888e+00,
6963           0.2464381430585e-08, 0.4599122275378e+01, 0.2091065926078e+00,
6964           0.2433408527044e-08, 0.2830751145445e+00, 0.2174915669488e+00,
6965           0.2443605509076e-08, 0.4212046432538e+01, 0.1739420156204e+00,
6966           0.2319779262465e-08, 0.9881978408630e+00, 0.7530171478090e-01,
6967           0.2284622835465e-08, 0.5565347331588e+00, 0.7426161660010e-01,
6968           0.2467268750783e-08, 0.5655708150766e+00, 0.2526561439362e+00,
6969           0.2808513492782e-08, 0.1418405053408e+01, 0.5636314030725e+00,
6970 
6971           0.2329528932532e-08, 0.4069557545675e+01, 0.1056200952181e+01,
6972           0.9698639532817e-09, 0.1074134313634e+01, 0.7826370942180e+02 };
6973 
6974     /* SSB-to-Sun, T^0, Y */
6975       static final double s0y[] = {
6976           0.4955392320126e-02, 0.2170467313679e+01, 0.5296909721118e+00,
6977           0.2722325167392e-02, 0.2444433682196e+01, 0.2132990797783e+00,
6978           0.1546579925346e-02, 0.5992779281546e+00, 0.3813291813120e-01,
6979           0.8363140252966e-03, 0.7687356310801e+00, 0.7478166569050e-01,
6980           0.3385792683603e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6981           0.1201192221613e-03, 0.2520035601514e+01, 0.1059381944224e+01,
6982           0.7587125720554e-04, 0.1669954006449e+01, 0.4265981595566e+00,
6983           0.1964155361250e-04, 0.5707743963343e+01, 0.2061856251104e+00,
6984           0.1891900364909e-04, 0.2320960679937e+01, 0.2204125344462e+00,
6985           0.1937373433356e-04, 0.3226940689555e+01, 0.1495633313810e+00,
6986 
6987           0.1437139941351e-04, 0.2301626908096e+01, 0.5225775174439e+00,
6988           0.1406267683099e-04, 0.5188579265542e+01, 0.5368044267797e+00,
6989           0.1178703080346e-04, 0.5489483248476e+01, 0.7626583626240e-01,
6990           0.8079835186041e-05, 0.1683751835264e+01, 0.3664874755930e-01,
6991           0.7623253594652e-05, 0.2656400462961e+01, 0.3961708870310e-01,
6992           0.6248667483971e-05, 0.4992775362055e+01, 0.7329749511860e-01,
6993           0.4366353695038e-05, 0.2869706279678e+01, 0.1589072916335e+01,
6994           0.3829101568895e-05, 0.3572131359950e+01, 0.7113454667900e-02,
6995           0.3175733773908e-05, 0.4535372530045e+01, 0.4194847048887e+00,
6996           0.3092437902159e-05, 0.9230153317909e+00, 0.6398972393349e+00,
6997 
6998           0.2874168812154e-05, 0.3363143761101e+01, 0.1102062672231e+00,
6999           0.3040119321826e-05, 0.3324250895675e+01, 0.6283075850446e+01,
7000           0.2699723308006e-05, 0.2917882441928e+00, 0.1030928125552e+00,
7001           0.2134832683534e-05, 0.4220997202487e+01, 0.3163918923335e+00,
7002           0.1770412139433e-05, 0.4747318496462e+01, 0.1021328554739e+02,
7003           0.1377264209373e-05, 0.4305058462401e+00, 0.1484170571900e-02,
7004           0.1127814538960e-05, 0.8538177240740e+00, 0.6327837846670e+00,
7005           0.1055608090130e-05, 0.1551800742580e+01, 0.4337116142245e+00,
7006           0.9802673861420e-06, 0.1459646735377e+01, 0.1052268489556e+01,
7007           0.1090329461951e-05, 0.1587351228711e+01, 0.1162474756779e+01,
7008 
7009           0.6959590025090e-06, 0.5534442628766e+01, 0.1066495398892e+01,
7010           0.5664914529542e-06, 0.6030673003297e+01, 0.9491756770005e+00,
7011           0.6607787763599e-06, 0.4989507233927e+01, 0.8460828644453e+00,
7012           0.6269725742838e-06, 0.4222951804572e+01, 0.1480791608091e+00,
7013           0.6301889697863e-06, 0.5444316669126e+01, 0.2243449970715e+00,
7014           0.4891042662861e-06, 0.1490552839784e+01, 0.3340612434717e+01,
7015           0.3457083123290e-06, 0.3030475486049e+01, 0.3516457698740e-01,
7016           0.3032559967314e-06, 0.2652038793632e+01, 0.1104591729320e-01,
7017           0.2841133988903e-06, 0.1276744786829e+01, 0.4110125927500e-01,
7018           0.2855564444432e-06, 0.2143368674733e+01, 0.1510475019529e+00,
7019 
7020           0.2765157135038e-06, 0.5444186109077e+01, 0.6373574839730e-01,
7021           0.2382312465034e-06, 0.2190521137593e+01, 0.2275259891141e+00,
7022           0.2808060365077e-06, 0.5735195064841e+01, 0.2535050500000e-01,
7023           0.2332175234405e-06, 0.9481985524859e-01, 0.7181332454670e-01,
7024           0.2322488199659e-06, 0.5180499361533e+01, 0.8582758298370e-01,
7025           0.1881850258423e-06, 0.3219788273885e+01, 0.2118763888447e+01,
7026           0.2196111392808e-06, 0.2366941159761e+01, 0.2968341143800e-02,
7027           0.2183810335519e-06, 0.4825445110915e+01, 0.7775000683430e-01,
7028           0.2002733093326e-06, 0.2457148995307e+01, 0.2093666171530e+00,
7029           0.1967111767229e-06, 0.5586291545459e+01, 0.2172315424036e+00,
7030 
7031           0.1568473250543e-06, 0.3708003123320e+01, 0.7429900518901e+00,
7032           0.1852528314300e-06, 0.4310638151560e+01, 0.2022531624851e+00,
7033           0.1832111226447e-06, 0.1494665322656e+01, 0.3235053470014e+00,
7034           0.1746805502310e-06, 0.1451378500784e+01, 0.1385174140878e+00,
7035           0.1555730966650e-06, 0.1068040418198e+01, 0.7358765972222e+00,
7036           0.1554883462559e-06, 0.2442579035461e+01, 0.5154640627760e+00,
7037           0.1638380568746e-06, 0.2597913420625e+00, 0.8531963191132e+00,
7038           0.1159938593640e-06, 0.5834512021280e+01, 0.1990721704425e+00,
7039           0.1083427965695e-06, 0.5054033177950e+01, 0.5439178814476e+00,
7040           0.1156480369431e-06, 0.5325677432457e+01, 0.5257585094865e+00,
7041 
7042           0.1141308860095e-06, 0.2153403923857e+01, 0.5336234347371e+00,
7043           0.7913146470946e-07, 0.8642846847027e+00, 0.1478866649112e+01,
7044           0.7439752463733e-07, 0.1970628496213e+01, 0.2164800718209e+00,
7045           0.7280277104079e-07, 0.6073307250609e+01, 0.2101180877357e+00,
7046           0.8319567719136e-07, 0.1954371928334e+01, 0.1692165728891e+01,
7047           0.7137705549290e-07, 0.8904989440909e+00, 0.4155522422634e+00,
7048           0.6900825396225e-07, 0.2825717714977e+01, 0.1173197218910e+00,
7049           0.7245757216635e-07, 0.2481677513331e+01, 0.1265567569334e+01,
7050           0.6961165696255e-07, 0.1292955312978e+01, 0.9562891316684e+00,
7051           0.7571804456890e-07, 0.3427517575069e+01, 0.1422690933580e-01,
7052 
7053           0.6605425721904e-07, 0.8052192701492e+00, 0.6470106940028e+00,
7054           0.7375477357248e-07, 0.1705076390088e+01, 0.1581959461667e+01,
7055           0.7041664951470e-07, 0.4848356967891e+00, 0.9597935788730e-01,
7056           0.6322199535763e-07, 0.3878069473909e+01, 0.7084920306520e-01,
7057           0.5244380279191e-07, 0.2645560544125e+01, 0.5265099800692e+00,
7058           0.5143125704988e-07, 0.4834486101370e+01, 0.5328719641544e+00,
7059           0.5871866319373e-07, 0.7981472548900e+00, 0.7871412831580e-01,
7060           0.6300822573871e-07, 0.5979398788281e+01, 0.2608790314060e+02,
7061           0.6062154271548e-07, 0.4108655402756e+01, 0.1114304132498e+00,
7062           0.4361912339976e-07, 0.5322624319280e+01, 0.1375773836557e+01,
7063 
7064           0.4417005920067e-07, 0.6240817359284e+01, 0.2770348281756e+00,
7065           0.4686806749936e-07, 0.3214977301156e+01, 0.1143987543936e+00,
7066           0.3758892132305e-07, 0.5879809634765e+01, 0.1596186371003e+01,
7067           0.5151351332319e-07, 0.2893377688007e+00, 0.2228608264996e+00,
7068           0.4554683578572e-07, 0.5475427144122e+01, 0.1465949902372e+00,
7069           0.3442381385338e-07, 0.5992034796640e+01, 0.5070101000000e-01,
7070           0.2831093954933e-07, 0.5367350273914e+01, 0.3092784376656e+00,
7071           0.3756267090084e-07, 0.5758171285420e+01, 0.4903339079539e+00,
7072           0.2816374679892e-07, 0.1863718700923e+01, 0.2991266627620e+00,
7073           0.3419307025569e-07, 0.9524347534130e+00, 0.3518164938661e+00,
7074 
7075           0.2904250494239e-07, 0.5304471615602e+01, 0.1099462426779e+00,
7076           0.2471734511206e-07, 0.1297069793530e+01, 0.6256703299991e+00,
7077           0.2539620831872e-07, 0.3281126083375e+01, 0.1256615170089e+02,
7078           0.2281017868007e-07, 0.1829122133165e+01, 0.6681224869435e+01,
7079           0.2275319473335e-07, 0.5797198160181e+01, 0.3932462625300e-02,
7080           0.2547755368442e-07, 0.4752697708330e+01, 0.1169588211447e+01,
7081           0.2285979669317e-07, 0.1223205292886e+01, 0.1045155034888e+01,
7082           0.1913386560994e-07, 0.1757532993389e+01, 0.1155361302111e+01,
7083           0.1809020525147e-07, 0.4246116108791e+01, 0.3368040641550e-01,
7084           0.1649213300201e-07, 0.1445162890627e+01, 0.4408250688924e+00,
7085 
7086           0.1834972793932e-07, 0.1126917567225e+01, 0.4452511715700e-02,
7087           0.1439550648138e-07, 0.6160756834764e+01, 0.9420622223326e+00,
7088           0.1487645457041e-07, 0.4358761931792e+01, 0.4123712502208e+00,
7089           0.1731729516660e-07, 0.6134456753344e+01, 0.2108507877249e+00,
7090           0.1717747163567e-07, 0.1898186084455e+01, 0.2157473718317e+00,
7091           0.1418190430374e-07, 0.4180286741266e+01, 0.6521991896920e-01,
7092           0.1404844134873e-07, 0.7654053565412e-01, 0.4258542984690e-01,
7093           0.1409842846538e-07, 0.4418612420312e+01, 0.2258291676434e+00,
7094           0.1090948346291e-07, 0.1260615686131e+01, 0.4226656969313e+00,
7095           0.1357577323612e-07, 0.3558248818690e+01, 0.7923417740620e-01,
7096 
7097           0.1018154061960e-07, 0.5676087241256e+01, 0.1456308687557e+00,
7098           0.1412073972109e-07, 0.8394392632422e+00, 0.1525316725248e+00,
7099           0.1030938326496e-07, 0.1653593274064e+01, 0.1795258541446e+01,
7100           0.1180081567104e-07, 0.1285802592036e+01, 0.7032915397480e-01,
7101           0.9708510575650e-08, 0.7631889488106e+00, 0.8434341241180e-01,
7102           0.9637689663447e-08, 0.4630642649176e+01, 0.1272681024002e+01,
7103           0.1068910429389e-07, 0.5294934032165e+01, 0.2123349582968e+00,
7104           0.1063716179336e-07, 0.2736266800832e+01, 0.2142632012598e+00,
7105           0.1234858713814e-07, 0.1302891146570e+01, 0.1847279083684e+00,
7106           0.8912631189738e-08, 0.3570415993621e+01, 0.2648454860559e+01,
7107 
7108           0.1036378285534e-07, 0.4236693440949e+01, 0.1370332435159e+00,
7109           0.9667798501561e-08, 0.2960768892398e+01, 0.4376440768498e+00,
7110           0.8108314201902e-08, 0.6987781646841e+00, 0.2880807454688e+00,
7111           0.7648364324628e-08, 0.2499017863863e+01, 0.2037373330570e+00,
7112           0.7286136828406e-08, 0.3787426951665e+01, 0.1129145838217e+00,
7113           0.9448237743913e-08, 0.2694354332983e+01, 0.5272426800584e+00,
7114           0.9374276106428e-08, 0.4787121277064e+01, 0.5321392641652e+00,
7115           0.7100226287462e-08, 0.3530238792101e+00, 0.6288513220417e+00,
7116           0.9253056659571e-08, 0.1399478925664e+01, 0.1606092486742e+00,
7117           0.6636432145504e-08, 0.3479575438447e+01, 0.1368660381889e+01,
7118 
7119           0.6469975312932e-08, 0.1383669964800e+01, 0.2008557621224e+01,
7120           0.7335849729765e-08, 0.1243698166898e+01, 0.9561746721300e-02,
7121           0.8743421205855e-08, 0.3776164289301e+01, 0.3801276407308e+00,
7122           0.5993635744494e-08, 0.5627122113596e+01, 0.2042657109477e+02,
7123           0.5981008479693e-08, 0.1674336636752e+01, 0.2111650433779e+01,
7124           0.6188535145838e-08, 0.5214925208672e+01, 0.4305306221819e+00,
7125           0.6596074017566e-08, 0.2907653268124e+01, 0.1063314406849e+01,
7126           0.6630815126226e-08, 0.2127643669658e+01, 0.8389694097774e+00,
7127           0.6156772830040e-08, 0.5082160803295e+01, 0.4234171675140e+00,
7128           0.6446960563014e-08, 0.1872100916905e+01, 0.5287268506303e+00,
7129 
7130           0.6429324424668e-08, 0.5610276103577e+01, 0.5306550935933e+00,
7131           0.6302232396465e-08, 0.1592152049607e+01, 0.1253008786510e-01,
7132           0.6399244436159e-08, 0.2746214421532e+01, 0.5217580628120e+02,
7133           0.5474965172558e-08, 0.2317666374383e+01, 0.2221856701002e+01,
7134           0.5339293190692e-08, 0.1084724961156e+01, 0.7466759693650e-01,
7135           0.5334733683389e-08, 0.3594106067745e+01, 0.7489573444450e-01,
7136           0.5392665782110e-08, 0.5630254365606e+01, 0.1055449481598e+01,
7137           0.6682075673789e-08, 0.1518480041732e+01, 0.2213766559277e+00,
7138           0.5079130495960e-08, 0.2739765115711e+01, 0.2132517061319e+00,
7139           0.5077759793261e-08, 0.5290711290094e+01, 0.2133464534247e+00,
7140 
7141           0.4832037368310e-08, 0.1404473217200e+01, 0.7160067364790e-01,
7142           0.6463279674802e-08, 0.6038381695210e+01, 0.2209183458640e-01,
7143           0.6240592771560e-08, 0.1290170653666e+01, 0.3306188016693e+00,
7144           0.4672013521493e-08, 0.3261895939677e+01, 0.7796265773310e-01,
7145           0.6500650750348e-08, 0.1154522312095e+01, 0.3884652414254e+00,
7146           0.6344161389053e-08, 0.6206111545062e+01, 0.7605151500000e-01,
7147           0.4682518370646e-08, 0.5409118796685e+01, 0.1073608853559e+01,
7148           0.5329460015591e-08, 0.1202985784864e+01, 0.7287631425543e+00,
7149           0.5701588675898e-08, 0.4098715257064e+01, 0.8731175355560e-01,
7150           0.6030690867211e-08, 0.4132033218460e+00, 0.9846002785331e+00,
7151 
7152           0.4336256312655e-08, 0.1211415991827e+01, 0.4297791515992e+00,
7153           0.4688498808975e-08, 0.3765479072409e+01, 0.2127790306879e+00,
7154           0.4675578609335e-08, 0.4265540037226e+01, 0.2138191288687e+00,
7155           0.4225578112158e-08, 0.5237566010676e+01, 0.3407705765729e+00,
7156           0.5139422230028e-08, 0.1507173079513e+01, 0.7233337363710e-01,
7157           0.4619995093571e-08, 0.9023957449848e-01, 0.8603097737811e+00,
7158           0.4494776255461e-08, 0.5414930552139e+00, 0.7381754420900e-01,
7159           0.4274026276788e-08, 0.4145735303659e+01, 0.7574578717200e-01,
7160           0.5018141789353e-08, 0.3344408829055e+01, 0.3180992042600e-02,
7161           0.4866163952181e-08, 0.3348534657607e+01, 0.7722995774390e-01,
7162 
7163           0.4111986020501e-08, 0.4198823597220e+00, 0.1451108196653e+00,
7164           0.3356142784950e-08, 0.5609144747180e+01, 0.1274714967946e+00,
7165           0.4070575554551e-08, 0.7028411059224e+00, 0.3503323232942e+00,
7166           0.3257451857278e-08, 0.5624697983086e+01, 0.5296435984654e+00,
7167           0.3256973703026e-08, 0.1857842076707e+01, 0.5297383457582e+00,
7168           0.3830771508640e-08, 0.4562887279931e+01, 0.9098186128426e+00,
7169           0.3725024005962e-08, 0.2358058692652e+00, 0.1084620721060e+00,
7170           0.3136763921756e-08, 0.2049731526845e+01, 0.2346394437820e+00,
7171           0.3795147256194e-08, 0.2432356296933e+00, 0.1862120789403e+00,
7172           0.2877342229911e-08, 0.5631101279387e+01, 0.1905464808669e+01,
7173 
7174           0.3076931798805e-08, 0.1117615737392e+01, 0.3628624111593e+00,
7175           0.2734765945273e-08, 0.5899826516955e+01, 0.2131850110243e+00,
7176           0.2733405296885e-08, 0.2130562964070e+01, 0.2134131485323e+00,
7177           0.2898552353410e-08, 0.3462387048225e+00, 0.5291709230214e+00,
7178           0.2893736103681e-08, 0.8534352781543e+00, 0.5302110212022e+00,
7179           0.3095717734137e-08, 0.2875061429041e+01, 0.2976424921901e+00,
7180           0.2636190425832e-08, 0.2242512846659e+01, 0.1485980103780e+01,
7181           0.3645512095537e-08, 0.1354016903958e+01, 0.6044726378023e+00,
7182           0.2808173547723e-08, 0.6705114365631e-01, 0.6225157782540e-01,
7183           0.2625012866888e-08, 0.4775705748482e+01, 0.5268983110410e-01,
7184 
7185           0.2572233995651e-08, 0.2638924216139e+01, 0.1258454114666e+01,
7186           0.2604238824792e-08, 0.4826358927373e+01, 0.2103781122809e+00,
7187           0.2596886385239e-08, 0.3200388483118e+01, 0.2162200472757e+00,
7188           0.3228057304264e-08, 0.5384848409563e+01, 0.2007689919132e+00,
7189           0.2481601798252e-08, 0.5173373487744e+01, 0.1062562936266e+01,
7190           0.2745977498864e-08, 0.6250966149853e+01, 0.5651155736444e+00,
7191           0.2669878833811e-08, 0.4906001352499e+01, 0.1400015846597e+00,
7192           0.3203986611711e-08, 0.5034333010005e+01, 0.7036329877322e+00,
7193           0.3354961227212e-08, 0.6108262423137e+01, 0.4549093064213e+00,
7194           0.2400407324558e-08, 0.2135399294955e+01, 0.2125476091956e+00,
7195 
7196           0.2379905859802e-08, 0.5893721933961e+01, 0.2140505503610e+00,
7197           0.2550844302187e-08, 0.3331940762063e+01, 0.1534957940063e+00,
7198           0.2268824211001e-08, 0.1843418461035e+01, 0.2235935264888e+00,
7199           0.2464700891204e-08, 0.3029548547230e+01, 0.2091065926078e+00,
7200           0.2436814726024e-08, 0.4994717970364e+01, 0.2174915669488e+00,
7201           0.2443623894745e-08, 0.2645102591375e+01, 0.1739420156204e+00,
7202           0.2318701783838e-08, 0.5700547397897e+01, 0.7530171478090e-01,
7203           0.2284448700256e-08, 0.5268898905872e+01, 0.7426161660010e-01,
7204           0.2468848123510e-08, 0.5276280575078e+01, 0.2526561439362e+00,
7205           0.2814052350303e-08, 0.6130168623475e+01, 0.5636314030725e+00,
7206 
7207           0.2243662755220e-08, 0.6631692457995e+00, 0.8886590321940e-01,
7208           0.2330795855941e-08, 0.2499435487702e+01, 0.1056200952181e+01,
7209           0.9757679038404e-09, 0.5796846023126e+01, 0.7826370942180e+02 };
7210 
7211     /* SSB-to-Sun, T^0, Z */
7212       static  final double s0z[] = {
7213           0.1181255122986e-03, 0.4607918989164e+00, 0.2132990797783e+00,
7214           0.1127777651095e-03, 0.4169146331296e+00, 0.5296909721118e+00,
7215           0.4777754401806e-04, 0.4582657007130e+01, 0.3813291813120e-01,
7216           0.1129354285772e-04, 0.5758735142480e+01, 0.7478166569050e-01,
7217          -0.1149543637123e-04, 0.0000000000000e+00, 0.0000000000000e+00,
7218           0.3298730512306e-05, 0.5978801994625e+01, 0.4265981595566e+00,
7219           0.2733376706079e-05, 0.7665413691040e+00, 0.1059381944224e+01,
7220           0.9426389657270e-06, 0.3710201265838e+01, 0.2061856251104e+00,
7221           0.8187517749552e-06, 0.3390675605802e+00, 0.2204125344462e+00,
7222           0.4080447871819e-06, 0.4552296640088e+00, 0.5225775174439e+00,
7223 
7224           0.3169973017028e-06, 0.3445455899321e+01, 0.5368044267797e+00,
7225           0.2438098615549e-06, 0.5664675150648e+01, 0.3664874755930e-01,
7226           0.2601897517235e-06, 0.1931894095697e+01, 0.1495633313810e+00,
7227           0.2314558080079e-06, 0.3666319115574e+00, 0.3961708870310e-01,
7228           0.1962549548002e-06, 0.3167411699020e+01, 0.7626583626240e-01,
7229           0.2180518287925e-06, 0.1544420746580e+01, 0.7113454667900e-02,
7230           0.1451382442868e-06, 0.1583756740070e+01, 0.1102062672231e+00,
7231           0.1358439007389e-06, 0.5239941758280e+01, 0.6398972393349e+00,
7232           0.1050585898028e-06, 0.2266958352859e+01, 0.3163918923335e+00,
7233           0.1050029870186e-06, 0.2711495250354e+01, 0.4194847048887e+00,
7234 
7235           0.9934920679800e-07, 0.1116208151396e+01, 0.1589072916335e+01,
7236           0.1048395331560e-06, 0.3408619600206e+01, 0.1021328554739e+02,
7237           0.8370147196668e-07, 0.3810459401087e+01, 0.2535050500000e-01,
7238           0.7989856510998e-07, 0.3769910473647e+01, 0.7329749511860e-01,
7239           0.5441221655233e-07, 0.2416994903374e+01, 0.1030928125552e+00,
7240           0.4610812906784e-07, 0.5858503336994e+01, 0.4337116142245e+00,
7241           0.3923022803444e-07, 0.3354170010125e+00, 0.1484170571900e-02,
7242           0.2610725582128e-07, 0.5410600646324e+01, 0.6327837846670e+00,
7243           0.2455279767721e-07, 0.6120216681403e+01, 0.1162474756779e+01,
7244           0.2375530706525e-07, 0.6055443426143e+01, 0.1052268489556e+01,
7245 
7246           0.1782967577553e-07, 0.3146108708004e+01, 0.8460828644453e+00,
7247           0.1581687095238e-07, 0.6255496089819e+00, 0.3340612434717e+01,
7248           0.1594657672461e-07, 0.3782604300261e+01, 0.1066495398892e+01,
7249           0.1563448615040e-07, 0.1997775733196e+01, 0.2022531624851e+00,
7250           0.1463624258525e-07, 0.1736316792088e+00, 0.3516457698740e-01,
7251           0.1331585056673e-07, 0.4331941830747e+01, 0.9491756770005e+00,
7252           0.1130634557637e-07, 0.6152017751825e+01, 0.2968341143800e-02,
7253           0.1028949607145e-07, 0.2101792614637e+00, 0.2275259891141e+00,
7254           0.1024074971618e-07, 0.4071833211074e+01, 0.5070101000000e-01,
7255           0.8826956060303e-08, 0.4861633688145e+00, 0.2093666171530e+00,
7256 
7257           0.8572230171541e-08, 0.5268190724302e+01, 0.4110125927500e-01,
7258           0.7649332643544e-08, 0.5134543417106e+01, 0.2608790314060e+02,
7259           0.8581673291033e-08, 0.2920218146681e+01, 0.1480791608091e+00,
7260           0.8430589300938e-08, 0.3604576619108e+01, 0.2172315424036e+00,
7261           0.7776165501012e-08, 0.3772942249792e+01, 0.6373574839730e-01,
7262           0.8311070234408e-08, 0.6200412329888e+01, 0.3235053470014e+00,
7263           0.6927365212582e-08, 0.4543353113437e+01, 0.8531963191132e+00,
7264           0.6791574208598e-08, 0.2882188406238e+01, 0.7181332454670e-01,
7265           0.5593100811839e-08, 0.1776646892780e+01, 0.7429900518901e+00,
7266           0.4553381853021e-08, 0.3949617611240e+01, 0.7775000683430e-01,
7267 
7268           0.5758000450068e-08, 0.3859251775075e+01, 0.1990721704425e+00,
7269           0.4281283457133e-08, 0.1466294631206e+01, 0.2118763888447e+01,
7270           0.4206935661097e-08, 0.5421776011706e+01, 0.1104591729320e-01,
7271           0.4213751641837e-08, 0.3412048993322e+01, 0.2243449970715e+00,
7272           0.5310506239878e-08, 0.5421641370995e+00, 0.5154640627760e+00,
7273           0.3827450341320e-08, 0.8887314524995e+00, 0.1510475019529e+00,
7274           0.4292435241187e-08, 0.1405043757194e+01, 0.1422690933580e-01,
7275           0.3189780702289e-08, 0.1060049293445e+01, 0.1173197218910e+00,
7276           0.3226611928069e-08, 0.6270858897442e+01, 0.2164800718209e+00,
7277           0.2893897608830e-08, 0.5117563223301e+01, 0.6470106940028e+00,
7278 
7279           0.3239852024578e-08, 0.4079092237983e+01, 0.2101180877357e+00,
7280           0.2956892222200e-08, 0.1594917021704e+01, 0.3092784376656e+00,
7281           0.2980177912437e-08, 0.5258787667564e+01, 0.4155522422634e+00,
7282           0.3163725690776e-08, 0.3854589225479e+01, 0.8582758298370e-01,
7283           0.2662262399118e-08, 0.3561326430187e+01, 0.5257585094865e+00,
7284           0.2766689135729e-08, 0.3180732086830e+00, 0.1385174140878e+00,
7285           0.2411600278464e-08, 0.3324798335058e+01, 0.5439178814476e+00,
7286           0.2483527695131e-08, 0.4169069291947e+00, 0.5336234347371e+00,
7287           0.7788777276590e-09, 0.1900569908215e+01, 0.5217580628120e+02 };
7288 
7289     /* SSB-to-Sun, T^1, X */
7290       static  final double s1x[] = {
7291          -0.1296310361520e-07, 0.0000000000000e+00, 0.0000000000000e+00,
7292           0.8975769009438e-08, 0.1128891609250e+01, 0.4265981595566e+00,
7293           0.7771113441307e-08, 0.2706039877077e+01, 0.2061856251104e+00,
7294           0.7538303866642e-08, 0.2191281289498e+01, 0.2204125344462e+00,
7295           0.6061384579336e-08, 0.3248167319958e+01, 0.1059381944224e+01,
7296           0.5726994235594e-08, 0.5569981398610e+01, 0.5225775174439e+00,
7297           0.5616492836424e-08, 0.5057386614909e+01, 0.5368044267797e+00,
7298           0.1010881584769e-08, 0.3473577116095e+01, 0.7113454667900e-02,
7299           0.7259606157626e-09, 0.3651858593665e+00, 0.6398972393349e+00,
7300           0.8755095026935e-09, 0.1662835408338e+01, 0.4194847048887e+00,
7301 
7302           0.5370491182812e-09, 0.1327673878077e+01, 0.4337116142245e+00,
7303           0.5743773887665e-09, 0.4250200846687e+01, 0.2132990797783e+00,
7304           0.4408103140300e-09, 0.3598752574277e+01, 0.1589072916335e+01,
7305           0.3101892374445e-09, 0.4887822983319e+01, 0.1052268489556e+01,
7306           0.3209453713578e-09, 0.9702272295114e+00, 0.5296909721118e+00,
7307           0.3017228286064e-09, 0.5484462275949e+01, 0.1066495398892e+01,
7308           0.3200700038601e-09, 0.2846613338643e+01, 0.1495633313810e+00,
7309           0.2137637279911e-09, 0.5692163292729e+00, 0.3163918923335e+00,
7310           0.1899686386727e-09, 0.2061077157189e+01, 0.2275259891141e+00,
7311           0.1401994545308e-09, 0.4177771136967e+01, 0.1102062672231e+00,
7312 
7313           0.1578057810499e-09, 0.5782460597335e+01, 0.7626583626240e-01,
7314           0.1237713253351e-09, 0.5705900866881e+01, 0.5154640627760e+00,
7315           0.1313076837395e-09, 0.5163438179576e+01, 0.3664874755930e-01,
7316           0.1184963304860e-09, 0.3054804427242e+01, 0.6327837846670e+00,
7317           0.1238130878565e-09, 0.2317292575962e+01, 0.3961708870310e-01,
7318           0.1015959527736e-09, 0.2194643645526e+01, 0.7329749511860e-01,
7319           0.9017954423714e-10, 0.2868603545435e+01, 0.1990721704425e+00,
7320           0.8668024955603e-10, 0.4923849675082e+01, 0.5439178814476e+00,
7321           0.7756083930103e-10, 0.3014334135200e+01, 0.9491756770005e+00,
7322           0.7536503401741e-10, 0.2704886279769e+01, 0.1030928125552e+00,
7323 
7324           0.5483308679332e-10, 0.6010983673799e+01, 0.8531963191132e+00,
7325           0.5184339620428e-10, 0.1952704573291e+01, 0.2093666171530e+00,
7326           0.5108658712030e-10, 0.2958575786649e+01, 0.2172315424036e+00,
7327           0.5019424524650e-10, 0.1736317621318e+01, 0.2164800718209e+00,
7328           0.4909312625978e-10, 0.3167216416257e+01, 0.2101180877357e+00,
7329           0.4456638901107e-10, 0.7697579923471e+00, 0.3235053470014e+00,
7330           0.4227030350925e-10, 0.3490910137928e+01, 0.6373574839730e-01,
7331           0.4095456040093e-10, 0.5178888984491e+00, 0.6470106940028e+00,
7332           0.4990537041422e-10, 0.3323887668974e+01, 0.1422690933580e-01,
7333           0.4321170010845e-10, 0.4288484987118e+01, 0.7358765972222e+00,
7334 
7335           0.3544072091802e-10, 0.6021051579251e+01, 0.5265099800692e+00,
7336           0.3480198638687e-10, 0.4600027054714e+01, 0.5328719641544e+00,
7337           0.3440287244435e-10, 0.4349525970742e+01, 0.8582758298370e-01,
7338           0.3330628322713e-10, 0.2347391505082e+01, 0.1104591729320e-01,
7339           0.2973060707184e-10, 0.4789409286400e+01, 0.5257585094865e+00,
7340           0.2932606766089e-10, 0.5831693799927e+01, 0.5336234347371e+00,
7341           0.2876972310953e-10, 0.2692638514771e+01, 0.1173197218910e+00,
7342           0.2827488278556e-10, 0.2056052487960e+01, 0.2022531624851e+00,
7343           0.2515028239756e-10, 0.7411863262449e+00, 0.9597935788730e-01,
7344           0.2853033744415e-10, 0.3948481024894e+01, 0.2118763888447e+01 };
7345 
7346     /* SSB-to-Sun, T^1, Y */
7347       static  final double s1y[] = {
7348           0.8989047573576e-08, 0.5840593672122e+01, 0.4265981595566e+00,
7349           0.7815938401048e-08, 0.1129664707133e+01, 0.2061856251104e+00,
7350           0.7550926713280e-08, 0.6196589104845e+00, 0.2204125344462e+00,
7351           0.6056556925895e-08, 0.1677494667846e+01, 0.1059381944224e+01,
7352           0.5734142698204e-08, 0.4000920852962e+01, 0.5225775174439e+00,
7353           0.5614341822459e-08, 0.3486722577328e+01, 0.5368044267797e+00,
7354           0.1028678147656e-08, 0.1877141024787e+01, 0.7113454667900e-02,
7355           0.7270792075266e-09, 0.5077167301739e+01, 0.6398972393349e+00,
7356           0.8734141726040e-09, 0.9069550282609e-01, 0.4194847048887e+00,
7357           0.5377371402113e-09, 0.6039381844671e+01, 0.4337116142245e+00,
7358 
7359           0.4729719431571e-09, 0.2153086311760e+01, 0.2132990797783e+00,
7360           0.4458052820973e-09, 0.5059830025565e+01, 0.5296909721118e+00,
7361           0.4406855467908e-09, 0.2027971692630e+01, 0.1589072916335e+01,
7362           0.3101659310977e-09, 0.3317677981860e+01, 0.1052268489556e+01,
7363           0.3016749232545e-09, 0.3913703482532e+01, 0.1066495398892e+01,
7364           0.3198541352656e-09, 0.1275513098525e+01, 0.1495633313810e+00,
7365           0.2142065389871e-09, 0.5301351614597e+01, 0.3163918923335e+00,
7366           0.1902615247592e-09, 0.4894943352736e+00, 0.2275259891141e+00,
7367           0.1613410990871e-09, 0.2449891130437e+01, 0.1102062672231e+00,
7368           0.1576992165097e-09, 0.4211421447633e+01, 0.7626583626240e-01,
7369 
7370           0.1241637259894e-09, 0.4140803368133e+01, 0.5154640627760e+00,
7371           0.1313974830355e-09, 0.3591920305503e+01, 0.3664874755930e-01,
7372           0.1181697118258e-09, 0.1506314382788e+01, 0.6327837846670e+00,
7373           0.1238239742779e-09, 0.7461405378404e+00, 0.3961708870310e-01,
7374           0.1010107068241e-09, 0.6271010795475e+00, 0.7329749511860e-01,
7375           0.9226316616509e-10, 0.1259158839583e+01, 0.1990721704425e+00,
7376           0.8664946419555e-10, 0.3353244696934e+01, 0.5439178814476e+00,
7377           0.7757230468978e-10, 0.1447677295196e+01, 0.9491756770005e+00,
7378           0.7693168628139e-10, 0.1120509896721e+01, 0.1030928125552e+00,
7379           0.5487897454612e-10, 0.4439380426795e+01, 0.8531963191132e+00,
7380 
7381           0.5196118677218e-10, 0.3788856619137e+00, 0.2093666171530e+00,
7382           0.5110853339935e-10, 0.1386879372016e+01, 0.2172315424036e+00,
7383           0.5027804534813e-10, 0.1647881805466e+00, 0.2164800718209e+00,
7384           0.4922485922674e-10, 0.1594315079862e+01, 0.2101180877357e+00,
7385           0.6155599524400e-10, 0.0000000000000e+00, 0.0000000000000e+00,
7386           0.4447147832161e-10, 0.5480720918976e+01, 0.3235053470014e+00,
7387           0.4144691276422e-10, 0.1931371033660e+01, 0.6373574839730e-01,
7388           0.4099950625452e-10, 0.5229611294335e+01, 0.6470106940028e+00,
7389           0.5060541682953e-10, 0.1731112486298e+01, 0.1422690933580e-01,
7390           0.4293615946300e-10, 0.2714571038925e+01, 0.7358765972222e+00,
7391 
7392           0.3545659845763e-10, 0.4451041444634e+01, 0.5265099800692e+00,
7393           0.3479112041196e-10, 0.3029385448081e+01, 0.5328719641544e+00,
7394           0.3438516493570e-10, 0.2778507143731e+01, 0.8582758298370e-01,
7395           0.3297341285033e-10, 0.7898709807584e+00, 0.1104591729320e-01,
7396           0.2972585818015e-10, 0.3218785316973e+01, 0.5257585094865e+00,
7397           0.2931707295017e-10, 0.4260731012098e+01, 0.5336234347371e+00,
7398           0.2897198149403e-10, 0.1120753978101e+01, 0.1173197218910e+00,
7399           0.2832293240878e-10, 0.4597682717827e+00, 0.2022531624851e+00,
7400           0.2864348326612e-10, 0.2169939928448e+01, 0.9597935788730e-01,
7401           0.2852714675471e-10, 0.2377659870578e+01, 0.2118763888447e+01 };
7402 
7403     /* SSB-to-Sun, T^1, Z */
7404       static final double s1z[] = {
7405           0.5444220475678e-08, 0.1803825509310e+01, 0.2132990797783e+00,
7406           0.3883412695596e-08, 0.4668616389392e+01, 0.5296909721118e+00,
7407           0.1334341434551e-08, 0.0000000000000e+00, 0.0000000000000e+00,
7408           0.3730001266883e-09, 0.5401405918943e+01, 0.2061856251104e+00,
7409           0.2894929197956e-09, 0.4932415609852e+01, 0.2204125344462e+00,
7410           0.2857950357701e-09, 0.3154625362131e+01, 0.7478166569050e-01,
7411           0.2499226432292e-09, 0.3657486128988e+01, 0.4265981595566e+00,
7412           0.1937705443593e-09, 0.5740434679002e+01, 0.1059381944224e+01,
7413           0.1374894396320e-09, 0.1712857366891e+01, 0.5368044267797e+00,
7414           0.1217248678408e-09, 0.2312090870932e+01, 0.5225775174439e+00,
7415 
7416           0.7961052740870e-10, 0.5283368554163e+01, 0.3813291813120e-01,
7417           0.4979225949689e-10, 0.4298290471860e+01, 0.4194847048887e+00,
7418           0.4388552286597e-10, 0.6145515047406e+01, 0.7113454667900e-02,
7419           0.2586835212560e-10, 0.3019448001809e+01, 0.6398972393349e+00 };
7420 
7421     /* SSB-to-Sun, T^2, X */
7422       static  final double s2x[] = {
7423           0.1603551636587e-11, 0.4404109410481e+01, 0.2061856251104e+00,
7424           0.1556935889384e-11, 0.4818040873603e+00, 0.2204125344462e+00,
7425           0.1182594414915e-11, 0.9935762734472e+00, 0.5225775174439e+00,
7426           0.1158794583180e-11, 0.3353180966450e+01, 0.5368044267797e+00,
7427           0.9597358943932e-12, 0.5567045358298e+01, 0.2132990797783e+00,
7428           0.6511516579605e-12, 0.5630872420788e+01, 0.4265981595566e+00,
7429           0.7419792747688e-12, 0.2156188581957e+01, 0.5296909721118e+00,
7430           0.3951972655848e-12, 0.1981022541805e+01, 0.1059381944224e+01,
7431           0.4478223877045e-12, 0.0000000000000e+00, 0.0000000000000e+00 };
7432 
7433     /* SSB-to-Sun, T^2, Y */
7434       static final double s2y[] = {
7435           0.1609114495091e-11, 0.2831096993481e+01, 0.2061856251104e+00,
7436           0.1560330784946e-11, 0.5193058213906e+01, 0.2204125344462e+00,
7437           0.1183535479202e-11, 0.5707003443890e+01, 0.5225775174439e+00,
7438           0.1158183066182e-11, 0.1782400404928e+01, 0.5368044267797e+00,
7439           0.1032868027407e-11, 0.4036925452011e+01, 0.2132990797783e+00,
7440           0.6540142847741e-12, 0.4058241056717e+01, 0.4265981595566e+00,
7441           0.7305236491596e-12, 0.6175401942957e+00, 0.5296909721118e+00,
7442          -0.5580725052968e-12, 0.0000000000000e+00, 0.0000000000000e+00,
7443           0.3946122651015e-12, 0.4108265279171e+00, 0.1059381944224e+01 };
7444 
7445     /* SSB-to-Sun, T^2, Z */
7446       static final double s2z[] = {
7447           0.3749920358054e-12, 0.3230285558668e+01, 0.2132990797783e+00,
7448           0.2735037220939e-12, 0.6154322683046e+01, 0.5296909721118e+00 };
7449         }
7450       
7451         /**
7452          *  Earth position and velocity, heliocentric and barycentric, with
7453          *  respect to the Barycentric Celestial Reference System.
7454          *
7455          *<p>This function is derived from the International Astronomical Union's
7456          *  SOFA (Standards Of Fundamental Astronomy) software collection.
7457          *
7458          *<p>Status:  support function.
7459          *
7460          *<!-- Given: -->
7461          *     @param date1 double         TDB date (Note 1)
7462          *     @param date2 double         TDB date (Note 1) 
7463          *
7464          *<!-- Returned: -->
7465          *     @param pvh           double[2][3]    <u>returned</u> heliocentric Earth position/velocity (au, au/d)
7466          *     @param pvb           double[2][3]    <u>returned</u> barycentric Earth position/velocity (au, au/d)
7467          *
7468          * <!-- Returned (function value): -->
7469          *  @return int           status: 0 = OK
7470          *                                       +1 = warning: date outside
7471          *                                            the range 1900-2100 AD
7472          *
7473          * <p>Notes:
7474          * <ol>
7475          *
7476          * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
7477          *     convenient way between the two arguments.  For example,
7478          *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
7479          *     others:
7480          *<pre>
7481          *            date1          date2
7482          *
7483          *         2450123.7           0.0       (JD method)
7484          *         2451545.0       -1421.3       (J2000 method)
7485          *         2400000.5       50123.2       (MJD method)
7486          *         2450123.5           0.2       (date &amp; time method)
7487          *</pre>
7488          *     The JD method is the most natural and convenient to use in cases
7489          *     where the loss of several decimal digits of resolution is
7490          *     acceptable.  The J2000 method is best matched to the way the
7491          *     argument is handled internally and will deliver the optimum
7492          *     resolution.  The MJD method and the date &amp; time methods are both
7493          *     good compromises between resolution and convenience.  However,
7494          *     the accuracy of the result is more likely to be limited by the
7495          *     algorithm itself than the way the date has been expressed.
7496          *
7497          *     n.b. TT can be used instead of TDB in most applications.
7498          *
7499          * <li> On return, the arrays pvh and pvb contain the following:
7500          *
7501          *        pvh[0][0]  x       }
7502          *        pvh[0][1]  y       } heliocentric position, au
7503          *        pvh[0][2]  z       }
7504          *
7505          *        pvh[1][0]  xdot    }
7506          *        pvh[1][1]  ydot    } heliocentric velocity, au/d
7507          *        pvh[1][2]  zdot    }
7508          *
7509          *        pvb[0][0]  x       }
7510          *        pvb[0][1]  y       } barycentric position, au
7511          *        pvb[0][2]  z       }
7512          *
7513          *        pvb[1][0]  xdot    }
7514          *        pvb[1][1]  ydot    } barycentric velocity, au/d
7515          *        pvb[1][2]  zdot    }
7516          *
7517          *     The vectors are with respect to the Barycentric Celestial
7518          *     Reference System.  The time unit is one day in TDB.
7519          *
7520          * <li> The function is a SIMPLIFIED SOLUTION from the planetary theory
7521          *     VSOP2000 (X. Moisson, P. Bretagnon, 2001, Celes. Mechanics &amp;
7522          *     Dyn. Astron., 80, 3/4, 205-213) and is an adaptation of original
7523          *     Fortran code supplied by P. Bretagnon (private comm., 2000).
7524          *
7525          * <li> Comparisons over the time span 1900-2100 with this simplified
7526          *     solution and the JPL DE405 ephemeris give the following results:
7527          *
7528          *                                RMS    max
7529          *           Heliocentric:
7530          *              position error    3.7   11.2   km
7531          *              velocity error    1.4    5.0   mm/s
7532          *
7533          *           Barycentric:
7534          *              position error    4.6   13.4   km
7535          *              velocity error    1.4    4.9   mm/s
7536          *
7537          *     Comparisons with the JPL DE406 ephemeris show that by 1800 and
7538          *     2200 the position errors are approximately double their 1900-2100
7539          *     size.  By 1500 and 2500 the deterioration is a factor of 10 and
7540          *     by 1000 and 3000 a factor of 60.  The velocity accuracy falls off
7541          *     at about half that rate.
7542          *
7543          * <li> It is permissible to use the same array for pvh and pvb, which
7544          *     will receive the barycentric values.
7545          *</ol>
7546          *@version 2008 November 18
7547          *
7548          *  @since Release 20101201
7549          *
7550          *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7551          */
7552          public static int jauEpv00(final double date1, final double date2,
7553                       double pvh[][], double pvb[][])
7554          {
7555          /*
7556          * Matrix elements for orienting the analytical model to DE405.
7557          *
7558          * The corresponding Euler angles are:
7559          *
7560          *                       d  '  "
7561          *   1st rotation    -  23 26 21.4091 about the x-axis  (obliquity)
7562          *   2nd rotation    +         0.0475 about the z-axis  (RA offset)
7563          *
7564          * These were obtained empirically, by comparisons with DE405 over
7565          * 1900-2100.
7566          */
7567             final double am12 =  0.000000211284,
7568                                 am13 = -0.000000091603,
7569                                 am21 = -0.000000230286,
7570                                 am22 =  0.917482137087,
7571                                 am23 = -0.397776982902,
7572                                 am32 =  0.397776982902,
7573                                 am33 =  0.917482137087;
7574             
7575       
7576         
7577         
7578     /* Pointers to coefficient arrays, in x,y,z sets */
7579        final double ce0[][] = { Ephemeris.e0x, Ephemeris.e0y, Ephemeris.e0z },
7580                            ce1[][] = { Ephemeris.e1x, Ephemeris.e1y, Ephemeris.e1z },
7581                            ce2[][] = { Ephemeris.e2x, Ephemeris.e2y, Ephemeris.e2z },
7582                            cs0[][] = { Ephemeris.s0x, Ephemeris.s0y, Ephemeris.s0z },
7583                            cs1[][] = { Ephemeris.s1x, Ephemeris.s1y, Ephemeris.s1z },
7584                            cs2[][] = { Ephemeris.s2x, Ephemeris.s2y, Ephemeris.s2z };
7585        /* Numbers of terms for each component of the model, in x,y,z sets */
7586        final int ne0[] = {Ephemeris.e0x.length/3,
7587                Ephemeris.e0y.length/3,
7588                Ephemeris.e0z.length/3 },
7589                         ne1[] = {Ephemeris.e1x.length/3,
7590                Ephemeris.e1y.length/3,
7591                Ephemeris.e1z.length/3 },
7592                         ne2[] = {Ephemeris.e2x.length/3,
7593                Ephemeris.e2y.length/3,
7594                Ephemeris.e2z.length/3 },
7595                         ns0[] = {Ephemeris.s0x.length/3,
7596                Ephemeris.s0y.length/3,
7597                Ephemeris.s0z.length/3 },
7598                         ns1[] = {Ephemeris.s1x.length/3,
7599                Ephemeris.s1y.length/3,
7600                Ephemeris.s1z.length/3 },
7601                         ns2[] = {Ephemeris.s2x.length/3,
7602                Ephemeris.s2y.length/3,
7603                Ephemeris.s2z.length/3 };
7604        int nterms;
7605 
7606     /* Miscellaneous */
7607        int jstat, i, j;
7608        double t, t2, xyz, xyzd, a, b, c, ct, p, cp,
7609               ph[] = new double[3], vh[] = new double[3], pb[] = new double[3], vb[] = new double[3], x, y, z;
7610 
7611     /*--------------------------------------------------------------------*/
7612 
7613     /* Time since reference epoch, Julian years. */
7614        t = ((date1 - DJ00) + date2) / DJY;
7615        t2 = t*t;
7616 
7617     /* Set status. */
7618        jstat = abs(t) <= 100.0 ? 0 : 1;
7619 
7620     /* X then Y then Z. */
7621        for (i = 0; i < 3; i++) {
7622 
7623        /* Initialize position and velocity component. */
7624           xyz = 0.0;
7625           xyzd = 0.0;
7626 
7627        /* ------------------------------------------------ */
7628        /* Obtain component of Sun to Earth ecliptic vector */
7629        /* ------------------------------------------------ */
7630 
7631        /* Sun to Earth, T^0 terms. */
7632           nterms = ne0[i];
7633           int idx;
7634           for (j = 0, idx=0; j < nterms; j++) {
7635              a = ce0[i][idx++];
7636              b = ce0[i][idx++];
7637              c = ce0[i][idx++];
7638              p = b + c*t;
7639              xyz  += a*cos(p);
7640              xyzd -= a*c*sin(p);
7641           }
7642 
7643        /* Sun to Earth, T^1 terms. */
7644           nterms = ne1[i];
7645           for (j = 0, idx= 0; j < nterms; j++) {
7646              a = ce1[i][idx++];
7647              b = ce1[i][idx++];
7648              c = ce1[i][idx++];
7649              ct = c*t;
7650              p = b + ct;
7651              cp = cos(p);
7652              xyz  += a*t*cp;
7653              xyzd += a*( cp - ct*sin(p) );
7654           }
7655 
7656        /* Sun to Earth, T^2 terms. */
7657           nterms = ne2[i];
7658           for (j = 0, idx = 0; j < nterms; j++) {
7659              a = ce2[i][idx++];
7660              b = ce2[i][idx++];
7661              c = ce2[i][idx++];
7662              ct = c*t;
7663              p = b + ct;
7664              cp = cos(p);
7665              xyz  += a*t2*cp;
7666              xyzd += a*t*( 2.0*cp - ct*sin(p) );
7667           }
7668 
7669        /* Heliocentric Earth position and velocity component. */
7670           ph[i] = xyz;
7671           vh[i] = xyzd / DJY;
7672 
7673        /* ------------------------------------------------ */
7674        /* Obtain component of SSB to Earth ecliptic vector */
7675        /* ------------------------------------------------ */
7676 
7677        /* SSB to Sun, T^0 terms. */
7678           nterms = ns0[i];
7679           for (j = 0, idx = 0; j < nterms; j++) {
7680              a = cs0[i][idx++];
7681              b = cs0[i][idx++];
7682              c = cs0[i][idx++];
7683              p = b + c*t;
7684              xyz  += a*cos(p);
7685              xyzd -= a*c*sin(p);
7686           }
7687 
7688        /* SSB to Sun, T^1 terms. */
7689           nterms = ns1[i];
7690           for (j = 0, idx = 0; j < nterms; j++) {
7691              a = cs1[i][idx++];
7692              b = cs1[i][idx++];
7693              c = cs1[i][idx++];
7694              ct = c*t;
7695              p = b + ct;
7696              cp = cos(p);
7697              xyz  += a*t*cp;
7698              xyzd += a*(cp - ct*sin(p));
7699           }
7700 
7701        /* SSB to Sun, T^2 terms. */
7702           nterms = ns2[i];
7703           for (j = 0, idx = 0; j < nterms; j++) {
7704              a = cs2[i][idx++];
7705              b = cs2[i][idx++];
7706              c = cs2[i][idx++];
7707              ct = c*t;
7708              p = b + ct;
7709              cp = cos(p);
7710              xyz  += a*t2*cp;
7711              xyzd += a*t*(2.0*cp - ct*sin(p));
7712          }
7713 
7714        /* Barycentric Earth position and velocity component. */
7715          pb[i] = xyz;
7716          vb[i] = xyzd / DJY;
7717 
7718        /* Next Cartesian component. */
7719        }
7720 
7721     /* Rotate from ecliptic to BCRS coordinates. */
7722 
7723        x = ph[0];
7724        y = ph[1];
7725        z = ph[2];
7726        pvh[0][0] =      x + am12*y + am13*z;
7727        pvh[0][1] = am21*x + am22*y + am23*z;
7728        pvh[0][2] =          am32*y + am33*z;
7729 
7730        x = vh[0];
7731        y = vh[1];
7732        z = vh[2];
7733        pvh[1][0] =      x + am12*y + am13*z;
7734        pvh[1][1] = am21*x + am22*y + am23*z;
7735        pvh[1][2] =          am32*y + am33*z;
7736 
7737        x = pb[0];
7738        y = pb[1];
7739        z = pb[2];
7740        pvb[0][0] =      x + am12*y + am13*z;
7741        pvb[0][1] = am21*x + am22*y + am23*z;
7742        pvb[0][2] =          am32*y + am33*z;
7743 
7744        x = vb[0];
7745        y = vb[1];
7746        z = vb[2];
7747        pvb[1][0] =      x + am12*y + am13*z;
7748        pvb[1][1] = am21*x + am22*y + am23*z;
7749        pvb[1][2] =          am32*y + am33*z;
7750 
7751     /* Return the status. */
7752        return jstat;
7753 
7754         }
7755     
7756 
7757     /**
7758     *  Equation of the equinoxes, IAU 1994 model.
7759     *
7760     *<p>This function is derived from the International Astronomical Union's
7761     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7762     *
7763     *<p>Status:  canonical model.
7764     *
7765     *<!-- Given: -->
7766     *     @param date1 double      TDB date (Note 1)
7767     *     @param date2 double      TDB date (Note 1) 
7768     *
7769     * <!-- Returned (function value): -->
7770     *  @return double     equation of the equinoxes (Note 2)
7771     *
7772     * <p>Notes:
7773     * <ol>
7774     *
7775     * <li> The date date1+date2 is a Julian Date, apportioned in any
7776     *     convenient way between the two arguments.  For example,
7777     *     JD(TT)=2450123.7 could be expressed in any of these ways,
7778     *     among others:
7779     *<pre>
7780     *            date1          date2
7781     *
7782     *         2450123.7           0.0       (JD method)
7783     *         2451545.0       -1421.3       (J2000 method)
7784     *         2400000.5       50123.2       (MJD method)
7785     *         2450123.5           0.2       (date &amp; time method)
7786     *</pre>
7787     *     The JD method is the most natural and convenient to use in
7788     *     cases where the loss of several decimal digits of resolution
7789     *     is acceptable.  The J2000 method is best matched to the way
7790     *     the argument is handled internally and will deliver the
7791     *     optimum resolution.  The MJD method and the date &amp; time methods
7792     *     are both good compromises between resolution and convenience.
7793     *
7794     * <li> The result, which is in radians, operates in the following sense:
7795     *
7796     *        Greenwich apparent ST = GMST + equation of the equinoxes
7797     *</ol>
7798     *<p>Called:<ul>
7799     *     <li>{@link #jauNut80} nutation, IAU 1980
7800     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
7801     * </ul>
7802     *<p>References:
7803     *
7804     *     <p>IAU Resolution C7, Recommendation 3 (1994).
7805     *
7806     *     <p>Capitaine, N. &amp; Gontier, A.-M., 1993, Astron. Astrophys., 275,
7807     *     645-650.
7808     *
7809     *@version 2008 May 24
7810     *
7811     *  @since Release 20101201
7812     *
7813     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7814     */
7815     public static double jauEqeq94(double date1, double date2)
7816     {
7817        double t,  om,  eps0, ee;
7818 
7819 
7820     /* Interval between fundamental epoch J2000.0 and given date (JC). */
7821        t = ((date1 - DJ00) + date2) / DJC;
7822 
7823     /* Longitude of the mean ascending node of the lunar orbit on the */
7824     /* ecliptic, measured from the mean equinox of date. */
7825        om = jauAnpm((450160.280 + (-482890.539
7826                + (7.455 + 0.008 * t) * t) * t) * DAS2R
7827                + fmod(-5.0 * t, 1.0) * D2PI);
7828 
7829     /* Nutation components and mean obliquity. */
7830        NutationTerms nt = jauNut80(date1, date2);
7831        eps0 = jauObl80(date1, date2);
7832 
7833     /* Equation of the equinoxes. */
7834        ee = nt.dpsi*cos(eps0) + DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om));
7835 
7836        return ee;
7837 
7838         }
7839     
7840 
7841     /**
7842     *  Earth rotation angle (IAU 2000 model).
7843     *
7844     *<p>This function is derived from the International Astronomical Union's
7845     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7846     *
7847     *<p>Status:  canonical model.
7848     *
7849     *<!-- Given: -->
7850     *     @param dj1 double     UT1 as a 2-part Julian Date (see note)
7851     *     @param dj2 double     UT1 as a 2-part Julian Date (see note) 
7852     *
7853     * <!-- Returned (function value): -->
7854     *  @return double    Earth rotation angle (radians), range 0-2pi
7855     *
7856     * <p>Notes:
7857     * <ol>
7858     *
7859     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
7860     *     convenient way between the arguments dj1 and dj2.  For example,
7861     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
7862     *     among others:
7863     *<pre>
7864     *             dj1            dj2
7865     *
7866     *         2450123.7           0.0       (JD method)
7867     *         2451545.0       -1421.3       (J2000 method)
7868     *         2400000.5       50123.2       (MJD method)
7869     *         2450123.5           0.2       (date &amp; time method)
7870     *</pre>
7871     *     The JD method is the most natural and convenient to use in
7872     *     cases where the loss of several decimal digits of resolution
7873     *     is acceptable.  The J2000 and MJD methods are good compromises
7874     *     between resolution and convenience.  The date &amp; time method is
7875     *     best matched to the algorithm used:  maximum precision is
7876     *     delivered when the dj1 argument is for 0hrs UT1 on the day in
7877     *     question and the dj2 argument lies in the range 0 to 1, or vice
7878     *     versa.
7879     *
7880     * <li> The algorithm is adapted from Expression 22 of Capitaine et al.
7881     *     2000.  The time argument has been expressed in days directly,
7882     *     and, to retain precision, integer contributions have been
7883     *     eliminated.  The same formulation is given in IERS Conventions
7884     *     (2003), Chap. 5, Eq. 14.
7885     *</ol>
7886     *<p>Called:<ul>
7887     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
7888     * </ul>
7889     *<p>References:
7890     *
7891     *     <p>Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron.
7892     *     Astrophys., 355, 398-405.
7893     *
7894     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7895     *     IERS Technical Note No. 32, BKG (2004)
7896     *
7897     *@version 2008 May 24
7898     *
7899     *  @since Release 20101201
7900     *
7901     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7902     */
7903     public static double jauEra00(double dj1, double dj2)
7904     {
7905        double d1, d2, t, f, theta;
7906 
7907 
7908     /* Days since fundamental epoch. */
7909        if (dj1 < dj2) {
7910           d1 = dj1;
7911           d2 = dj2;
7912        } else {
7913           d1 = dj2;
7914           d2 = dj1;
7915        }
7916        t = d1 + (d2- DJ00);
7917 
7918     /* Fractional part of T (days). */
7919        f = fmod(d1, 1.0) + fmod(d2, 1.0);
7920 
7921     /* Earth rotation angle at this UT1. */
7922        theta = jauAnp(D2PI * (f + 0.7790572732640
7923                                 + 0.00273781191135448 * t));
7924 
7925        return theta;
7926 
7927         }
7928     
7929 
7930     /**
7931     *  Fundamental argument, IERS Conventions (2003):
7932     *  mean elongation of the Moon from the Sun.
7933     *
7934     *<p>This function is derived from the International Astronomical Union's
7935     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7936     *
7937     *<p>Status:  canonical model.
7938     *
7939     *<!-- Given: -->
7940     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
7941     *
7942     * <!-- Returned (function value): -->
7943     *  @return double    D, radians (Note 2)
7944     *
7945     * <p>Notes:
7946     * <ol>
7947     *
7948     * <li> Though t is strictly TDB, it is usually more convenient to use
7949     *     TT, which makes no significant difference.
7950     *
7951     * <li> The expression used is as adopted in IERS Conventions (2003) and
7952     *     is from Simon et al. (1994).
7953     *</ol>
7954     *<p>References:
7955     *
7956     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7957     *     IERS Technical Note No. 32, BKG (2004)
7958     *
7959     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
7960     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
7961     *
7962     *@version 2009 December 16
7963     *
7964     *  @since Release 20101201
7965     *
7966     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7967     */
7968     public static double jauFad03(double t)
7969     {
7970        double a;
7971 
7972 
7973     /* Mean elongation of the Moon from the Sun (IERS Conventions 2003). */
7974        a = fmod(          1072260.703692 +
7975                  t * ( 1602961601.2090 +
7976                  t * (        - 6.3706 +
7977                  t * (          0.006593 +
7978                  t * (        - 0.00003169 ) ) ) ), TURNAS ) * DAS2R;
7979 
7980        return a;
7981 
7982         }
7983     
7984 
7985     /**
7986     *  Fundamental argument, IERS Conventions (2003):
7987     *  mean longitude of Earth.
7988     *
7989     *<p>This function is derived from the International Astronomical Union's
7990     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7991     *
7992     *<p>Status:  canonical model.
7993     *
7994     *<!-- Given: -->
7995     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
7996     *
7997     * <!-- Returned (function value): -->
7998     *  @return double    mean longitude of Earth, radians (Note 2)
7999     *
8000     * <p>Notes:
8001     * <ol>
8002     *
8003     * <li> Though t is strictly TDB, it is usually more convenient to use
8004     *     TT, which makes no significant difference.
8005     *
8006     * <li> The expression used is as adopted in IERS Conventions (2003) and
8007     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8008     *</ol>
8009     *<p>References:
8010     *
8011     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8012     *     IERS Technical Note No. 32, BKG (2004)
8013     *
8014     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8015     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8016     *
8017     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8018     *     Astron.Astrophys.Supp.Ser. 135, 111
8019     *
8020     *@version 2009 December 16
8021     *
8022     *  @since Release 20101201
8023     *
8024     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8025     */
8026     public static double jauFae03(double t)
8027     {
8028        double a;
8029 
8030 
8031     /* Mean longitude of Earth (IERS Conventions 2003). */
8032        a = fmod(1.753470314 + 628.3075849991 * t, D2PI);
8033 
8034        return a;
8035 
8036         }
8037     
8038 
8039     /**
8040     *  Fundamental argument, IERS Conventions (2003):
8041     *  mean longitude of the Moon minus mean longitude of the ascending
8042     *  node.
8043     *
8044     *<p>This function is derived from the International Astronomical Union's
8045     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8046     *
8047     *<p>Status:  canonical model.
8048     *
8049     *<!-- Given: -->
8050     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8051     *
8052     * <!-- Returned (function value): -->
8053     *  @return double    F, radians (Note 2)
8054     *
8055     * <p>Notes:
8056     * <ol>
8057     *
8058     * <li> Though t is strictly TDB, it is usually more convenient to use
8059     *     TT, which makes no significant difference.
8060     *
8061     * <li> The expression used is as adopted in IERS Conventions (2003) and
8062     *     is from Simon et al. (1994).
8063     *</ol>
8064     *<p>References:
8065     *
8066     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8067     *     IERS Technical Note No. 32, BKG (2004)
8068     *
8069     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8070     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8071     *
8072     *@version 2009 December 16
8073     *
8074     *  @since Release 20101201
8075     *
8076     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8077     */
8078     public static double jauFaf03(double t)
8079     {
8080        double a;
8081 
8082 
8083     /* Mean longitude of the Moon minus that of the ascending node */
8084     /* (IERS Conventions 2003).                                    */
8085        a = fmod(           335779.526232 +
8086                  t * ( 1739527262.8478 +
8087                  t * (       - 12.7512 +
8088                  t * (        - 0.001037 +
8089                  t * (          0.00000417 ) ) ) ), TURNAS ) * DAS2R;
8090 
8091        return a;
8092 
8093 
8094         }
8095     
8096 
8097     /**
8098     *  Fundamental argument, IERS Conventions (2003):
8099     *  mean longitude of Jupiter.
8100     *
8101     *<p>This function is derived from the International Astronomical Union's
8102     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8103     *
8104     *<p>Status:  canonical model.
8105     *
8106     *<!-- Given: -->
8107     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8108     *
8109     * <!-- Returned (function value): -->
8110     *  @return double    mean longitude of Jupiter, radians (Note 2)
8111     *
8112     * <p>Notes:
8113     * <ol>
8114     *
8115     * <li> Though t is strictly TDB, it is usually more convenient to use
8116     *     TT, which makes no significant difference.
8117     *
8118     * <li> The expression used is as adopted in IERS Conventions (2003) and
8119     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8120     *</ol>
8121     *<p>References:
8122     *
8123     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8124     *     IERS Technical Note No. 32, BKG (2004)
8125     *
8126     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8127     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8128     *
8129     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8130     *     Astron.Astrophys.Supp.Ser. 135, 111
8131     *
8132     *@version 2009 December 16
8133     *
8134     *  @since Release 20101201
8135     *
8136     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8137     */
8138     public static double jauFaju03(double t)
8139     {
8140        double a;
8141 
8142 
8143     /* Mean longitude of Jupiter (IERS Conventions 2003). */
8144        a = fmod(0.599546497 + 52.9690962641 * t, D2PI);
8145 
8146        return a;
8147 
8148         }
8149     
8150 
8151     /**
8152     *  Fundamental argument, IERS Conventions (2003):
8153     *  mean anomaly of the Moon.
8154     *
8155     *<p>This function is derived from the International Astronomical Union's
8156     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8157     *
8158     *<p>Status:  canonical model.
8159     *
8160     *<!-- Given: -->
8161     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8162     *
8163     * <!-- Returned (function value): -->
8164     *  @return double    l, radians (Note 2)
8165     *
8166     * <p>Notes:
8167     * <ol>
8168     *
8169     * <li> Though t is strictly TDB, it is usually more convenient to use
8170     *     TT, which makes no significant difference.
8171     *
8172     * <li> The expression used is as adopted in IERS Conventions (2003) and
8173     *     is from Simon et al. (1994).
8174     *</ol>
8175     *<p>References:
8176     *
8177     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8178     *     IERS Technical Note No. 32, BKG (2004)
8179     *
8180     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8181     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8182     *
8183     *@version 2009 December 16
8184     *
8185     *  @since Release 20101201
8186     *
8187     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8188     */
8189     public static double jauFal03(double t)
8190     {
8191        double a;
8192 
8193 
8194     /* Mean anomaly of the Moon (IERS Conventions 2003). */
8195        a = fmod(           485868.249036  +
8196                  t * ( 1717915923.2178 +
8197                  t * (         31.8792 +
8198                  t * (          0.051635 +
8199                  t * (        - 0.00024470 ) ) ) ), TURNAS ) * DAS2R;
8200 
8201        return a;
8202 
8203         }
8204     
8205 
8206     /**
8207     *  Fundamental argument, IERS Conventions (2003):
8208     *  mean anomaly of the Sun.
8209     *
8210     *<p>This function is derived from the International Astronomical Union's
8211     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8212     *
8213     *<p>Status:  canonical model.
8214     *
8215     *<!-- Given: -->
8216     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8217     *
8218     * <!-- Returned (function value): -->
8219     *  @return double    l', radians (Note 2)
8220     *
8221     * <p>Notes:
8222     * <ol>
8223     *
8224     * <li> Though t is strictly TDB, it is usually more convenient to use
8225     *     TT, which makes no significant difference.
8226     *
8227     * <li> The expression used is as adopted in IERS Conventions (2003) and
8228     *     is from Simon et al. (1994).
8229     *</ol>
8230     *<p>References:
8231     *
8232     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8233     *     IERS Technical Note No. 32, BKG (2004)
8234     *
8235     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8236     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8237     *
8238     *@version 2009 December 16
8239     *
8240     *  @since Release 20101201
8241     *
8242     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8243     */
8244     public static double jauFalp03(double t)
8245     {
8246        double a;
8247 
8248 
8249     /* Mean anomaly of the Sun (IERS Conventions 2003). */
8250        a = fmod(         1287104.793048 +
8251                  t * ( 129596581.0481 +
8252                  t * (       - 0.5532 +
8253                  t * (         0.000136 +
8254                  t * (       - 0.00001149 ) ) ) ), TURNAS ) * DAS2R;
8255 
8256        return a;
8257 
8258         }
8259     
8260 
8261     /**
8262     *  Fundamental argument, IERS Conventions (2003):
8263     *  mean longitude of Mars.
8264     *
8265     *<p>This function is derived from the International Astronomical Union's
8266     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8267     *
8268     *<p>Status:  canonical model.
8269     *
8270     *<!-- Given: -->
8271     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8272     *
8273     * <!-- Returned (function value): -->
8274     *  @return double    mean longitude of Mars, radians (Note 2)
8275     *
8276     * <p>Notes:
8277     * <ol>
8278     *
8279     * <li> Though t is strictly TDB, it is usually more convenient to use
8280     *     TT, which makes no significant difference.
8281     *
8282     * <li> The expression used is as adopted in IERS Conventions (2003) and
8283     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8284     *</ol>
8285     *<p>References:
8286     *
8287     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8288     *     IERS Technical Note No. 32, BKG (2004)
8289     *
8290     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8291     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8292     *
8293     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8294     *     Astron.Astrophys.Supp.Ser. 135, 111
8295     *
8296     *@version 2009 December 16
8297     *
8298     *  @since Release 20101201
8299     *
8300     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8301     */
8302     public static double jauFama03(double t)
8303     {
8304        double a;
8305 
8306 
8307     /* Mean longitude of Mars (IERS Conventions 2003). */
8308        a = fmod(6.203480913 + 334.0612426700 * t, D2PI);
8309 
8310        return a;
8311 
8312         }
8313     
8314 
8315     /**
8316     *  Fundamental argument, IERS Conventions (2003):
8317     *  mean longitude of Mercury.
8318     *
8319     *<p>This function is derived from the International Astronomical Union's
8320     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8321     *
8322     *<p>Status:  canonical model.
8323     *
8324     *<!-- Given: -->
8325     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8326     *
8327     * <!-- Returned (function value): -->
8328     *  @return double    mean longitude of Mercury, radians (Note 2)
8329     *
8330     * <p>Notes:
8331     * <ol>
8332     *
8333     * <li> Though t is strictly TDB, it is usually more convenient to use
8334     *     TT, which makes no significant difference.
8335     *
8336     * <li> The expression used is as adopted in IERS Conventions (2003) and
8337     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8338     *</ol>
8339     *<p>References:
8340     *
8341     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8342     *     IERS Technical Note No. 32, BKG (2004)
8343     *
8344     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8345     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8346     *
8347     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8348     *     Astron.Astrophys.Supp.Ser. 135, 111
8349     *
8350     *@version 2009 December 16
8351     *
8352     *  @since Release 20101201
8353     *
8354     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8355     */
8356     public static double jauFame03(double t)
8357     {
8358        double a;
8359 
8360 
8361     /* Mean longitude of Mercury (IERS Conventions 2003). */
8362        a = fmod(4.402608842 + 2608.7903141574 * t, D2PI);
8363 
8364        return a;
8365 
8366         }
8367     
8368 
8369 
8370     /**
8371     *  Fundamental argument, IERS Conventions (2003):
8372     *  mean longitude of Neptune.
8373     *
8374     *<p>This function is derived from the International Astronomical Union's
8375     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8376     *
8377     *<p>Status:  canonical model.
8378     *
8379     *<!-- Given: -->
8380     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8381     *
8382     * <!-- Returned (function value): -->
8383     *  @return double    mean longitude of Neptune, radians (Note 2)
8384     *
8385     * <p>Notes:
8386     * <ol>
8387     *
8388     * <li> Though t is strictly TDB, it is usually more convenient to use
8389     *     TT, which makes no significant difference.
8390     *
8391     * <li> The expression used is as adopted in IERS Conventions (2003) and
8392     *     is adapted from Simon et al. (1994).
8393     *</ol>
8394     *<p>References:
8395     *
8396     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8397     *     IERS Technical Note No. 32, BKG (2004)
8398     *
8399     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8400     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8401     *
8402     *@version 2009 December 16
8403     *
8404     *  @since Release 20101201
8405     *
8406     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8407     */
8408     public static double jauFane03(double t)
8409     {
8410        double a;
8411 
8412 
8413     /* Mean longitude of Neptune (IERS Conventions 2003). */
8414        a = fmod(5.311886287 + 3.8133035638 * t, D2PI);
8415 
8416        return a;
8417 
8418         }
8419     
8420 
8421     /**
8422     *  Fundamental argument, IERS Conventions (2003):
8423     *  mean longitude of the Moon's ascending node.
8424     *
8425     *<p>This function is derived from the International Astronomical Union's
8426     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8427     *
8428     *<p>Status:  canonical model.
8429     *
8430     *<!-- Given: -->
8431     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8432     *
8433     * <!-- Returned (function value): -->
8434     *  @return double    Omega, radians (Note 2)
8435     *
8436     * <p>Notes:
8437     * <ol>
8438     *
8439     * <li> Though t is strictly TDB, it is usually more convenient to use
8440     *     TT, which makes no significant difference.
8441     *
8442     * <li> The expression used is as adopted in IERS Conventions (2003) and
8443     *     is from Simon et al. (1994).
8444     *</ol>
8445     *<p>References:
8446     *
8447     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8448     *     IERS Technical Note No. 32, BKG (2004)
8449     *
8450     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8451     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8452     *
8453     *@version 2009 December 16
8454     *
8455     *  @since Release 20101201
8456     *
8457     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8458     */
8459     public static double jauFaom03(double t)
8460     {
8461        double a;
8462 
8463 
8464     /* Mean longitude of the Moon's ascending node */
8465     /* (IERS Conventions 2003).                    */
8466        a = fmod(          450160.398036 +
8467                  t * ( - 6962890.5431 +
8468                  t * (         7.4722 +
8469                  t * (         0.007702 +
8470                  t * (       - 0.00005939 ) ) ) ), TURNAS ) * DAS2R;
8471 
8472        return a;
8473 
8474         }
8475     
8476 
8477     /**
8478     *  Fundamental argument, IERS Conventions (2003):
8479     *  general accumulated precession in longitude.
8480     *
8481     *<p>This function is derived from the International Astronomical Union's
8482     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8483     *
8484     *<p>Status:  canonical model.
8485     *
8486     *<!-- Given: -->
8487     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8488     *
8489     * <!-- Returned (function value): -->
8490     *  @return double    general precession in longitude, radians (Note 2)
8491     *
8492     * <p>Notes:
8493     * <ol>
8494     *
8495     * <li> Though t is strictly TDB, it is usually more convenient to use
8496     *     TT, which makes no significant difference.
8497     *
8498     * <li> The expression used is as adopted in IERS Conventions (2003).  It
8499     *     is taken from Kinoshita &amp; Souchay (1990) and comes originally
8500     *     from Lieske et al. (1977).
8501     *</ol>
8502     *<p>References:
8503     *
8504     *     Kinoshita, H. and Souchay J. 1990, Celest.Mech. and Dyn.Astron.
8505     *     48, 187
8506     *
8507     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
8508     *     Astron.Astrophys. 58, 1-16
8509     *
8510     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8511     *     IERS Technical Note No. 32, BKG (2004)
8512     *
8513     *@version 2009 December 16
8514     *
8515     *  @since Release 20101201
8516     *
8517     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8518     */
8519     public static double jauFapa03(double t)
8520     {
8521        double a;
8522 
8523 
8524     /* General accumulated precession in longitude. */
8525        a = (0.024381750 + 0.00000538691 * t) * t;
8526 
8527        return a;
8528 
8529         }
8530     
8531 
8532     /**
8533     *  Fundamental argument, IERS Conventions (2003):
8534     *  mean longitude of Saturn.
8535     *
8536     *<p>This function is derived from the International Astronomical Union's
8537     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8538     *
8539     *<p>Status:  canonical model.
8540     *
8541     *<!-- Given: -->
8542     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8543     *
8544     * <!-- Returned (function value): -->
8545     *  @return double    mean longitude of Saturn, radians (Note 2)
8546     *
8547     * <p>Notes:
8548     * <ol>
8549     *
8550     * <li> Though t is strictly TDB, it is usually more convenient to use
8551     *     TT, which makes no significant difference.
8552     *
8553     * <li> The expression used is as adopted in IERS Conventions (2003) and
8554     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8555     *</ol>
8556     *<p>References:
8557     *
8558     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8559     *     IERS Technical Note No. 32, BKG (2004)
8560     *
8561     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8562     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8563     *
8564     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8565     *     Astron.Astrophys.Supp.Ser. 135, 111
8566     *
8567     *@version 2009 December 16
8568     *
8569     *  @since Release 20101201
8570     *
8571     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8572     */
8573     public static double jauFasa03(double t)
8574     {
8575        double a;
8576 
8577 
8578     /* Mean longitude of Saturn (IERS Conventions 2003). */
8579        a = fmod(0.874016757 + 21.3299104960 * t, D2PI);
8580 
8581        return a;
8582 
8583         }
8584     
8585 
8586     /**
8587     *  Fundamental argument, IERS Conventions (2003):
8588     *  mean longitude of Uranus.
8589     *
8590     *<p>This function is derived from the International Astronomical Union's
8591     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8592     *
8593     *<p>Status:  canonical model.
8594     *
8595     *<!-- Given: -->
8596     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8597     *
8598     * <!-- Returned  (function value): -->
8599     *      @return     double    mean longitude of Uranus, radians (Note 2)
8600     *
8601     * <p>Notes:
8602     * <ol>
8603     *
8604     * <li> Though t is strictly TDB, it is usually more convenient to use
8605     *     TT, which makes no significant difference.
8606     *
8607     * <li> The expression used is as adopted in IERS Conventions (2003) and
8608     *     is adapted from Simon et al. (1994).
8609     *</ol>
8610     *<p>References:
8611     *
8612     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8613     *     IERS Technical Note No. 32, BKG (2004)
8614     *
8615     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8616     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8617     *
8618     *@version 2009 December 16
8619     *
8620     *  @since Release 20101201
8621     *
8622     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8623     */
8624     public static double jauFaur03(double t)
8625     {
8626        double a;
8627 
8628 
8629     /* Mean longitude of Uranus (IERS Conventions 2003). */
8630        a = fmod(5.481293872 + 7.4781598567 * t, D2PI);
8631 
8632        return a;
8633 
8634         }
8635     
8636 
8637     /**
8638     *  Fundamental argument, IERS Conventions (2003):
8639     *  mean longitude of Venus.
8640     *
8641     *<p>This function is derived from the International Astronomical Union's
8642     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8643     *
8644     *<p>Status:  canonical model.
8645     *
8646     *<!-- Given: -->
8647     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8648     *
8649     * <!-- Returned (function value): -->
8650     *  @return double    mean longitude of Venus, radians (Note 2)
8651     *
8652     * <p>Notes:
8653     * <ol>
8654     *
8655     * <li> Though t is strictly TDB, it is usually more convenient to use
8656     *     TT, which makes no significant difference.
8657     *
8658     * <li> The expression used is as adopted in IERS Conventions (2003) and
8659     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8660     *</ol>
8661     *<p>References:
8662     *
8663     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8664     *     IERS Technical Note No. 32, BKG (2004)
8665     *
8666     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8667     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8668     *
8669     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8670     *     Astron.Astrophys.Supp.Ser. 135, 111
8671     *
8672     *@version 2009 December 16
8673     *
8674     *  @since Release 20101201
8675     *
8676     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8677     */
8678     public static double jauFave03(double t)
8679     {
8680        double a;
8681 
8682 
8683     /* Mean longitude of Venus (IERS Conventions 2003). */
8684        a = fmod(3.176146697 + 1021.3285546211 * t, D2PI);
8685 
8686        return a;
8687 
8688         }
8689     
8690 
8691     /**
8692     *  Transform FK5 (J2000.0) star data into the Hipparcos system.
8693     *
8694     *<p>This function is derived from the International Astronomical Union's
8695     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8696     *
8697     *<p>Status:  support function.
8698     *
8699     *  Given (all FK5, equinox J2000.0, epoch J2000.0):
8700     *    @param r5      double    RA (radians)
8701     *    @param d5      double    Dec (radians)
8702     *    @param dr5     double    proper motion in RA (dRA/dt, rad/Jyear)
8703     *    @param dd5     double    proper motion in Dec (dDec/dt, rad/Jyear)
8704     *    @param px5     double    parallax (arcsec)
8705     *    @param rv5     double    radial velocity (km/s, positive = receding)
8706     *
8707     *  Returned (all Hipparcos, epoch J2000.0):
8708     *  @return catalogue coordinates
8709     *
8710     * <p>Notes:
8711     * <ol>
8712     *
8713     * <li> This function transforms FK5 star positions and proper motions
8714     *     into the system of the Hipparcos catalog.
8715     *
8716     * <li> The proper motions in RA are dRA/dt rather than
8717     *     cos(Dec)*dRA/dt, and are per year rather than per century.
8718     *
8719     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8720     *     rotation and spin;  zonal errors in the FK5 catalog are not
8721     *     taken into account.
8722     *
8723     * <li> See also {@link #jauH2fk5}, {@link #jauFk5hz}, {@link #jauHfk5z}.
8724     *</ol>
8725     *<p>Called:<ul>
8726     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
8727     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8728     *     <li>{@link #jauRxp} product of r-matrix and p-vector
8729     *     <li>{@link #jauPxp} vector product of two p-vectors
8730     *     <li>{@link #jauPpp} p-vector plus p-vector
8731     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
8732     * </ul>
8733     *<p>Reference:
8734     *
8735     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8736     *
8737     *@version 2009 December 17
8738     *
8739     *  @since Release 20101201
8740     *
8741     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8742     */
8743     public static CatalogCoords jauFk52h(double r5, double d5,
8744                   double dr5, double dd5, double px5, double rv5)
8745     {
8746        int i;
8747        double pv5[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pvh[][] = new double[2][3];
8748 
8749 
8750     /* FK5 barycentric position/velocity pv-vector (normalized). */
8751        jauStarpv(r5, d5, dr5, dd5, px5, rv5, pv5);
8752 
8753     /* FK5 to Hipparcos orientation matrix and spin vector. */
8754        jauFk5hip(r5h, s5h);
8755 
8756     /* Make spin units per day instead of per year. */
8757        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
8758 
8759     /* Orient the FK5 position into the Hipparcos system. */
8760        pvh[0] = jauRxp(r5h, pv5[0]);
8761 
8762     /* Apply spin to the position giving an extra space motion component. */
8763        wxp = jauPxp(pv5[0],s5h);
8764 
8765     /* Add this component to the FK5 space motion. */
8766        vv = jauPpp(wxp, pv5[1]);
8767 
8768     /* Orient the FK5 space motion into the Hipparcos system. */
8769        pvh[1] = jauRxp(r5h, vv);
8770 
8771     /* Hipparcos pv-vector to spherical. */
8772        CatalogCoords cat = null;
8773        try {
8774            cat = jauPvstar(pvh);
8775        } catch (JSOFAInternalError e) {
8776            //original code ignored possibility of error too...
8777            e.printStackTrace();
8778        }
8779 
8780        return cat;
8781 
8782         }
8783     
8784 
8785     /**
8786     *  FK5 to Hipparcos rotation and spin.
8787     *
8788     *<p>This function is derived from the International Astronomical Union's
8789     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8790     *
8791     *<p>Status:  support function.
8792     *
8793     *<!-- Returned: -->
8794     *     @param r5h    double[3][3]    <u>returned</u> r-matrix: FK5 rotation wrt Hipparcos (Note 2)
8795     *     @param s5h    double[3]       <u>returned</u> r-vector: FK5 spin wrt Hipparcos (Note 3)
8796     *
8797     * <p>Notes:
8798     * <ol>
8799     *
8800     * <li> This function models the FK5 to Hipparcos transformation as a
8801     *     pure rotation and spin;  zonal errors in the FK5 catalogue are
8802     *     not taken into account.
8803     *
8804     * <li> The r-matrix r5h operates in the sense:
8805     *
8806     *           P_Hipparcos = r5h x P_FK5
8807     *
8808     *     where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is
8809     *     the equivalent Hipparcos p-vector.
8810     *
8811     * <li> The r-vector s5h represents the time derivative of the FK5 to
8812     *     Hipparcos rotation.  The units are radians per year (Julian,
8813     *     TDB).
8814     *</ol>
8815     *<p>Called:<ul>
8816     *     <li>{@link #jauRv2m} r-vector to r-matrix
8817     * </ul>
8818     *<p>Reference:
8819     *
8820     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8821     *
8822     *@version 2009 March 14
8823     *
8824     *  @since Release 20101201
8825     *
8826     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8827     */
8828     public static void jauFk5hip(double r5h[][], double s5h[] )
8829     {
8830        double v[] = new double[3];
8831 
8832     /* FK5 wrt Hipparcos orientation and spin (radians, radians/year) */
8833        double epx, epy, epz;
8834        double omx, omy, omz;
8835 
8836 
8837        epx = -19.9e-3 * DAS2R;
8838        epy =  -9.1e-3 * DAS2R;
8839        epz =  22.9e-3 * DAS2R;
8840 
8841        omx = -0.30e-3 * DAS2R;
8842        omy =  0.60e-3 * DAS2R;
8843        omz =  0.70e-3 * DAS2R;
8844 
8845     /* FK5 to Hipparcos orientation expressed as an r-vector. */
8846        v[0] = epx;
8847        v[1] = epy;
8848        v[2] = epz;
8849 
8850     /* Re-express as an r-matrix. */
8851        double[][] r5ht = jauRv2m(v);
8852        jauCr(r5ht, r5h);
8853 
8854     /* Hipparcos wrt FK5 spin expressed as an r-vector. */
8855        s5h[0] = omx;
8856        s5h[1] = omy;
8857        s5h[2] = omz;
8858 
8859        return;
8860 
8861         }
8862     
8863   /**
8864   * Position consisting of (&alpha;, &delta;) pairs in radians. Where &alpha; is right ascension (or longitude angle) and &delta; is declination (or latitude angle).
8865  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
8866  * 
8867  * @since AIDA Stage 1
8868  * @TODO needs better name cf {@link SphericalPosition}
8869  */
8870 public static class SphericalCoordinate {
8871       public double alpha;
8872       public double delta;
8873       public SphericalCoordinate(double alpha, double delta){
8874           this.alpha = alpha;
8875           this.delta = delta;
8876       }
8877   }
8878 
8879 /**
8880  * Spherical coordinate with equation of origins .
8881  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
8882  * @version $Revision$ $date$
8883  */
8884 public static class SphericalCoordinateEO {
8885     public SphericalCoordinate pos;
8886     public double eo;
8887     /**
8888      * @param pos
8889      * @param eo
8890      */
8891     public SphericalCoordinateEO(SphericalCoordinate pos, double eo) {
8892         this.pos = pos;
8893         this.eo = eo;
8894     }
8895     
8896     
8897 }
8898     /**
8899     *  Transform an FK5 (J2000.0) star position into the system of the
8900     *  Hipparcos catalogue, assuming zero Hipparcos proper motion.
8901     *
8902     *<p>This function is derived from the International Astronomical Union's
8903     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8904     *
8905     *<p>Status:  support function.
8906     *
8907     *<!-- Given: -->
8908     *     @param r5            double    FK5 RA (radians), equinox J2000.0, at date
8909     *     @param d5            double    FK5 Dec (radians), equinox J2000.0, at date
8910     *     @param date1 double    TDB date (Notes 1,2)
8911     *     @param date2 double    TDB date (Notes 1,2) 
8912     *
8913     *<!-- Returned: -->
8914     *     @return rh            double     <u>returned</u> Hipparcos RA (radians)
8915     *             dh            double     <u>returned</u> Hipparcos Dec (radians)
8916     *
8917     * <p>Notes:
8918     * <ol>
8919     *
8920     * <li> This function converts a star position from the FK5 system to
8921     *     the Hipparcos system, in such a way that the Hipparcos proper
8922     *     motion is zero.  Because such a star has, in general, a non-zero
8923     *     proper motion in the FK5 system, the function requires the date
8924     *     at which the position in the FK5 system was determined.
8925     *
8926     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
8927     *     convenient way between the two arguments.  For example,
8928     *     JD(TT)=2450123.7 could be expressed in any of these ways,
8929     *     among others:
8930     *<pre>
8931     *            date1          date2
8932     *
8933     *         2450123.7           0.0       (JD method)
8934     *         2451545.0       -1421.3       (J2000 method)
8935     *         2400000.5       50123.2       (MJD method)
8936     *         2450123.5           0.2       (date &amp; time method)
8937     *</pre>
8938     *     The JD method is the most natural and convenient to use in
8939     *     cases where the loss of several decimal digits of resolution
8940     *     is acceptable.  The J2000 method is best matched to the way
8941     *     the argument is handled internally and will deliver the
8942     *     optimum resolution.  The MJD method and the date &amp; time methods
8943     *     are both good compromises between resolution and convenience.
8944     *
8945     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8946     *     rotation and spin;  zonal errors in the FK5 catalogue are not
8947     *     taken into account.
8948     *
8949     * <li> The position returned by this function is in the Hipparcos
8950     *     reference system but at date date1+date2.
8951     *
8952     * <li> See also jauFk52h, jauH2fk5, jauHfk5z.
8953     *</ol>
8954     *<p>Called:<ul>
8955     *     <li>{@link #jauS2c} spherical coordinates to unit vector
8956     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8957     *     <li>{@link #jauSxp} multiply p-vector by scalar
8958     *     <li>{@link #jauRv2m} r-vector to r-matrix
8959     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
8960     *     <li>{@link #jauPxp} vector product of two p-vectors
8961     *     <li>{@link #jauC2s} p-vector to spherical
8962     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
8963     * </ul>
8964     *<p>Reference:
8965     *
8966     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
8967     *
8968     *@version 2009 December 17
8969     *
8970     *  @since Release 20101201
8971     *
8972     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8973     */
8974     public static SphericalCoordinate jauFk5hz(double r5, double d5, double date1, double date2
8975                   )
8976     {
8977        double t, p5e[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], vst[] = new double[3], rst[][] = new double[3][3], p5[] = new double[3],
8978               ph[] = new double[3];
8979 
8980 
8981     /* Interval from given date to fundamental epoch J2000.0 (JY). */
8982        t = - ((date1 - DJ00) + date2) / DJY;
8983 
8984     /* FK5 barycentric position vector. */
8985        p5e = jauS2c(r5,d5);
8986 
8987     /* FK5 to Hipparcos orientation matrix and spin vector. */
8988        jauFk5hip(r5h, s5h);
8989 
8990     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
8991        vst = jauSxp(t,s5h);
8992 
8993     /* Express the accumulated spin as a rotation matrix. */
8994        rst = jauRv2m(vst);
8995 
8996     /* Derotate the vector's FK5 axes back to date. */
8997        p5 = jauTrxp(rst, p5e);
8998 
8999     /* Rotate the vector into the Hipparcos system. */
9000        ph = jauRxp(r5h, p5);
9001 
9002     /* Hipparcos vector to spherical. */
9003        SphericalCoordinate sc = jauC2s(ph);
9004        double rh = jauAnp(sc.alpha);
9005        sc.alpha = rh;
9006        
9007        return sc;
9008 
9009         }
9010     
9011 
9012     /**
9013     *  Form rotation matrix given the Fukushima-Williams angles.
9014     *
9015     *<p>This function is derived from the International Astronomical Union's
9016     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9017     *
9018     *<p>Status:  support function.
9019     *
9020     *<!-- Given: -->
9021     *     @param gamb      double          F-W angle gamma_bar (radians)
9022     *     @param phib      double          F-W angle phi_bar (radians)
9023     *     @param psi       double          F-W angle psi (radians)
9024     *     @param eps       double          F-W angle epsilon (radians)
9025     *
9026     *<!-- Returned: -->
9027     *     @return r         double[3][3]     <u>returned</u> rotation matrix
9028     *
9029     * <p>Notes:
9030     * <ol>
9031     *
9032     * <li> Naming the following points:
9033     *
9034     *           e = J2000.0 ecliptic pole,
9035     *           p = GCRS pole,
9036     *           E = ecliptic pole of date,
9037     *     and   P = CIP,
9038     *
9039     *     the four Fukushima-Williams angles are as follows:
9040     *
9041     *        gamb = gamma = epE
9042     *        phib = phi = pE
9043     *        psi = psi = pEP
9044     *        eps = epsilon = EP
9045     *
9046     * <li> The matrix representing the combined effects of frame bias,
9047     *     precession and nutation is:
9048     *
9049     *        NxPxB = R_1(-eps).R_3(-psi).R_1(phib).R_3(gamb)
9050     *
9051     * <li> Three different matrices can be constructed, depending on the
9052     *     supplied angles:
9053     *
9054     *     o  To obtain the nutation x precession x frame bias matrix,
9055     *        generate the four precession angles, generate the nutation
9056     *        components and add them to the psi_bar and epsilon_A angles,
9057     *        and call the present function.
9058     *
9059     *     o  To obtain the precession x frame bias matrix, generate the
9060     *        four precession angles and call the present function.
9061     *
9062     *     o  To obtain the frame bias matrix, generate the four precession
9063     *        angles for date J2000.0 and call the present function.
9064     *
9065     *     The nutation-only and precession-only matrices can if necessary
9066     *     be obtained by combining these three appropriately.
9067     *</ol>
9068     *<p>Called:<ul>
9069     *     <li>{@link #jauIr} initialize r-matrix to identity
9070     *     <li>{@link #jauRz} rotate around Z-axis
9071     *     <li>{@link #jauRx} rotate around X-axis
9072     * </ul>
9073     *<p>Reference:
9074     *
9075     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9076     *
9077     *@version 2009 December 17
9078     *
9079     *  @since Release 20101201
9080     *
9081     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9082     */
9083     public static double[][] jauFw2m(double gamb, double phib, double psi, double eps)
9084     {
9085     /* Construct the matrix. */
9086        double r[][] = new double[3][3];
9087        jauIr(r);
9088        jauRz(gamb, r);
9089        jauRx(phib, r);
9090        jauRz(-psi, r);
9091        jauRx(-eps, r);
9092 
9093        return r;
9094 
9095         }
9096     
9097 
9098     /**
9099     *  CIP X,Y given Fukushima-Williams bias-precession-nutation angles.
9100     *
9101     *<p>This function is derived from the International Astronomical Union's
9102     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9103     *
9104     *<p>Status:  support function.
9105     *
9106     *<!-- Given: -->
9107     *     @param gamb      double     F-W angle gamma_bar (radians)
9108     *     @param phib      double     F-W angle phi_bar (radians)
9109     *     @param psi       double     F-W angle psi (radians)
9110     *     @param eps       double     F-W angle epsilon (radians)
9111     *
9112     *<!-- Returned: -->
9113     *     @return CIP unit vector X,Y
9114     *
9115     * <p>Notes:
9116     * <ol>
9117     *
9118     * <li> Naming the following points:
9119     *
9120     *           e = J2000.0 ecliptic pole,
9121     *           p = GCRS pole
9122     *           E = ecliptic pole of date,
9123     *     and   P = CIP,
9124     *
9125     *     the four Fukushima-Williams angles are as follows:
9126     *
9127     *        gamb = gamma = epE
9128     *        phib = phi = pE
9129     *        psi = psi = pEP
9130     *        eps = epsilon = EP
9131     *
9132     * <li> The matrix representing the combined effects of frame bias,
9133     *     precession and nutation is:
9134     *
9135     *        NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
9136     *
9137     *       The returned values x,y are elements [2][0] and [2][1] of the
9138     *       matrix.  Near J2000.0, they are essentially angles in radians
9139     *       
9140     *     X,Y are elements (3,1) and (3,2) of the matrix.
9141     *</ol>
9142     *<p>Called:<ul>
9143     *     <li>{@link #jauFw2m} F-W angles to r-matrix
9144     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
9145     * </ul>
9146     *<p>Reference:
9147     *
9148     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9149     *
9150     *@version 2009 December 17
9151     *
9152     *  @since Release 20101201
9153     *
9154     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9155     */
9156     public static CelestialIntermediatePole jauFw2xy(double gamb, double phib, double psi, double eps)
9157     {
9158        double r[][] = new double[3][3];
9159 
9160 
9161     /* Form NxPxB matrix. */
9162        r = jauFw2m(gamb, phib, psi, eps);
9163 
9164     /* Extract CIP X,Y. */
9165        return jauBpn2xy(r);
9166 
9167     }
9168 
9169     /**
9170      * Geodetic coordinates.
9171      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
9172      * 
9173      * @since AIDA Stage 1
9174      */
9175     public static class GeodeticCoord {
9176         /** longitude (radians, east +ve) */
9177         public  double elong;
9178         /** latitude (geodetic, radians) */
9179         public double phi;
9180         /** height above ellipsoid (geodetic) */
9181         public double height;
9182         public GeodeticCoord(double elong, double phi, double height) {
9183             this.elong = elong;
9184             this.phi = phi;
9185             this.height = height;
9186         }
9187 }
9188     /**
9189     *  Transform geocentric coordinates to geodetic using the specified
9190     *  reference ellipsoid.
9191     *
9192     *<p>This function is derived from the International Astronomical Union's
9193     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9194     *
9195     *<p>Status:  canonical transformation.
9196     *
9197     *<!-- Given: -->
9198     *     @param n        int         ellipsoid identifier (Note 1)
9199     *     @param xyz      double[3]   geocentric vector (Note 2)
9200     *
9201     *<!-- Returned: -->
9202     *     @return elong    double       <u>returned</u> longitude (radians, east +ve)
9203     *             phi      double       <u>returned</u> latitude (geodetic, radians, Note 3)
9204     *             height   double       <u>returned</u> height above ellipsoid (geodetic, Notes 2,3)
9205     *
9206     * <!-- Returned (function value): -->
9207     *  @throws JSOFAIllegalParameter 0 = OK
9208     *                         -1 = illegal identifier (Note 3)
9209     *                         -2 = internal error (Note 3)
9210     *
9211     * <p>Notes:
9212     * <ol>
9213     *
9214     * <li> The identifier n is a number that specifies the choice of
9215     *     reference ellipsoid.  The following are supported:
9216     *
9217     *        n   ellipsoid
9218     *
9219     *        1    WGS84
9220     *        2    GRS80
9221     *
9222     *     The number n has no significance outside the JSOFA software.
9223     *
9224     * <li> The geocentric vector (xyz, given) and height (height, returned)
9225     *     are in meters.
9226     *
9227     * <li> An error status -1 means that the identifier n is illegal.  An
9228     *     error status -2 is theoretically impossible.  In all error cases,
9229     *     phi and height are both set to -1e9.
9230     *
9231     * <li> The inverse transformation is performed in the function jauGd2gc.
9232     *</ol>
9233     *<p>Called:<ul>
9234     *     <li>{@link #jauEform} Earth reference ellipsoids
9235     *     <li>{@link #jauGc2gde} geocentric to geodetic transformation, general
9236     * </ul>
9237     *@version 2010 January 18
9238     *
9239     *  @since Release 20101201
9240     *
9241     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9242     */
9243     public static GeodeticCoord jauGc2gd ( int n, double xyz[] ) throws JSOFAIllegalParameter
9244     {
9245       GeodeticCoord gc;
9246 
9247 
9248     /* Obtain reference ellipsoid parameters. */
9249        ReferenceEllipsoid el = jauEform ( n );
9250 
9251     /* If OK, transform x,y,z to longitude, geodetic latitude, height. */
9252        gc = jauGc2gde ( el.a, el.f, xyz);
9253 
9254     /* Return the status. */
9255        return gc;
9256 
9257     
9258     }
9259     
9260    /**
9261     *  Transform geocentric coordinates to geodetic for a reference
9262     *  ellipsoid of specified form.
9263     *
9264     *<p>This function is derived from the International Astronomical Union's
9265     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9266     *
9267     *<p>Status:  support function.
9268     *
9269     *<!-- Given: -->
9270     *     @param a        double      equatorial radius (Notes 2,4)
9271     *     @param f        double      flattening (Note 3)
9272     *     @param xyz      double[3]   geocentric vector (Note 4)
9273     *
9274     *<!-- Returned: -->
9275     *     @return GeodeticCoord   logitude  (radians, east +ve) latitude (geodetic, radians)  height above ellipsoid (geodetic, Note 4)
9276     *
9277     *  @throws JSOFAIllegalParameter int       status:
9278     *               
9279     *                         -1 = illegal a
9280     *                         -2 = illegal f
9281     *
9282     * <p>Notes:
9283     * <ol>
9284     *
9285     * <li> This function is based on the GCONV2H Fortran subroutine by
9286     *     Toshio Fukushima (see reference).
9287     *
9288     * <li> The equatorial radius, a, can be in any units, but meters is
9289     *     the conventional choice.
9290     *
9291     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9292     *     i.e. around 1/298.
9293     *
9294     * <li> The equatorial radius, a, and the geocentric vector, xyz,
9295     *     must be given in the same units, and determine the units of
9296     *     the returned height, height.
9297     *
9298     * <li> If an error occurs (status &lt; 0), elong, phi and height are
9299     *     unchanged.
9300     *
9301     * <li> The inverse transformation is performed in the function
9302     *     jauGd2gce.
9303     *
9304     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9305     *     more conveniently be performed by calling jauGc2gd, which uses a
9306     *     numerical code (1 for WGS84) to identify the required A and F
9307     *     values.
9308     *</ol>
9309     *<p>Reference:
9310     *
9311     *     Fukushima, T., "Transformation from Cartesian to geodetic
9312     *     coordinates accelerated by Halley's method", J.Geodesy (2006)
9313     *     79: 689-693
9314     *
9315     *@version 2009 November 2
9316     *
9317     *  @since Release 20101201
9318     *
9319     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9320  * 
9321     */
9322     public static GeodeticCoord jauGc2gde ( double a, double f, double xyz[] ) throws JSOFAIllegalParameter
9323         {
9324        double aeps2, e2, e4t, ec2, ec, b, x, y, z, p2, absz, p, s0, pn, zc,
9325                      c0, c02, c03, s02, s03, a02, a0, a03, d0, f0, b0, s1,
9326                      cc, s12, cc2;
9327 
9328       double  phi, height;
9329     /* ------------- */
9330     /* Preliminaries */
9331     /* ------------- */
9332 
9333     /* Validate ellipsoid parameters. */
9334        if ( f < 0.0 || f >= 1.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9335        if ( a <= 0.0 ) throw new JSOFAIllegalParameter("bad a", -2);
9336 
9337     /* Functions of ellipsoid parameters (with further validation of f). */
9338        aeps2 = a*a * 1e-32;
9339        e2 = (2.0 - f) * f;
9340        e4t = e2*e2 * 1.5;
9341        ec2 = 1.0 - e2;
9342        if ( ec2 <= 0.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9343        ec = sqrt(ec2);
9344        b = a * ec;
9345 
9346     /* Cartesian components. */
9347        x = xyz[0];
9348        y = xyz[1];
9349        z = xyz[2];
9350 
9351     /* Distance from polar axis squared. */
9352        p2 = x*x + y*y;
9353 
9354     /* Longitude. */
9355        double elong = p2 > 0.0 ? atan2(y, x) : 0.0;
9356 
9357     /* Unsigned z-coordinate. */
9358        absz = abs(z);
9359 
9360     /* Proceed unless polar case. */
9361        if ( p2 > aeps2 ) {
9362 
9363        /* Distance from polar axis. */
9364           p = sqrt(p2);
9365 
9366        /* Normalization. */
9367           s0 = absz / a;
9368           pn = p / a;
9369           zc = ec * s0;
9370 
9371        /* Prepare Newton correction factors. */
9372           c0 = ec * pn;
9373           c02 = c0 * c0;
9374           c03 = c02 * c0;
9375           s02 = s0 * s0;
9376           s03 = s02 * s0;
9377           a02 = c02 + s02;
9378           a0 = sqrt(a02);
9379           a03 = a02 * a0;
9380           d0 = zc*a03 + e2*s03;
9381           f0 = pn*a03 - e2*c03;
9382 
9383        /* Prepare Halley correction factor. */
9384           b0 = e4t * s02 * c02 * pn * (a0 - ec);
9385           s1 = d0*f0 - b0*s0;
9386           cc = ec * (f0*f0 - b0*c0);
9387 
9388        /* Evaluate latitude and height. */
9389           phi = atan(s1/cc);
9390           s12 = s1 * s1;
9391           cc2 = cc * cc;
9392           height = (p*cc + absz*s1 - a * sqrt(ec2*s12 + cc2)) /
9393                                                             sqrt(s12 + cc2);
9394        } else {
9395 
9396        /* Exception: pole. */
9397           phi = DPI / 2.0;
9398           height = absz - b;
9399        }
9400 
9401     /* Restore sign of latitude. */
9402        if ( z < 0 ) phi = -phi;
9403 
9404     /* OK status. */
9405        return new GeodeticCoord(elong, phi, height);
9406 
9407     
9408     }
9409     
9410 
9411     /**
9412     *  Transform geodetic coordinates to geocentric using the specified
9413     *  reference ellipsoid.
9414     *
9415     *<p>This function is derived from the International Astronomical Union's
9416     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9417     *
9418     *<p>Status:  canonical transformation.
9419     *
9420     *<!-- Given: -->
9421     *     @param n        int         ellipsoid identifier (Note 1)
9422     *     @param elong    double      longitude (radians, east +ve)
9423     *     @param phi      double      latitude (geodetic, radians, Note 3)
9424     *     @param height   double      height above ellipsoid (geodetic, Notes 2,3)
9425     *
9426     *<!-- Returned: -->
9427     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 2)
9428     *
9429     * <!-- Returned (function value): -->
9430     *  @throws JSOFAIllegalParameter    -1 = illegal identifier (Note 3)
9431     *                         -2 = illegal case (Note 3)
9432     *
9433     * <p>Notes:
9434     * <ol>
9435     *
9436     * <li> The identifier n is a number that specifies the choice of
9437     *     reference ellipsoid.  The following are supported:
9438     *
9439     *        n   ellipsoid
9440     *
9441     *        1    WGS84
9442     *        2    GRS80
9443     *
9444     *     The number n has no significance outside the JSOFA software.
9445     *
9446     * <li> The height (height, given) and the geocentric vector (xyz,
9447     *     returned) are in meters.
9448     *
9449     * <li> No validation is performed on the arguments elong, phi and
9450     *     height.  An error status -1 means that the identifier n is
9451     *     illegal.  An error status -2 protects against cases that would
9452     *     lead to arithmetic exceptions.  In all error cases, xyz is set
9453     *     to zeros.
9454     *
9455     * <li> The inverse transformation is performed in the function jauGc2gd.
9456     *</ol>
9457     *<p>Called:<ul>
9458     *     <li>{@link #jauEform} Earth reference ellipsoids
9459     *     <li>{@link #jauGd2gce} geodetic to geocentric transformation, general
9460     *     <li>{@link #jauZp} zero p-vector
9461     * </ul>
9462     *@version 2010 January 18
9463     *
9464     *  @since Release 20101201
9465     *
9466     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9467     */
9468     public static double[] jauGd2gc ( int n, double elong, double phi, double height ) throws JSOFAIllegalParameter, JSOFAInternalError
9469     {
9470 
9471 
9472     /* Obtain reference ellipsoid parameters. */
9473        ReferenceEllipsoid em = jauEform ( n );
9474 
9475     /* If OK, transform longitude, geodetic latitude, height to x,y,z. */
9476       return jauGd2gce ( em.a, em.f, elong, phi, height );
9477   
9478     
9479     }
9480     
9481 
9482     /**
9483     *  Transform geodetic coordinates to geocentric for a reference
9484     *  ellipsoid of specified form.
9485     *
9486     *<p>This function is derived from the International Astronomical Union's
9487     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9488     *
9489     *<p>Status:  support function.
9490     *
9491     *<!-- Given: -->
9492     *     @param a        double      equatorial radius (Notes 1,4)
9493     *     @param f        double      flattening (Notes 2,4)
9494     *     @param elong    double      longitude (radians, east +ve)
9495     *     @param phi      double      latitude (geodetic, radians, Note 4)
9496     *     @param height   double      height above ellipsoid (geodetic, Notes 3,4)
9497     *
9498     *<!-- Returned: -->
9499     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 3)
9500     *
9501     * <!-- Returned (function value): -->
9502     *  
9503     *  @throws JSOFAInternalError  0 = OK
9504     *                           -1 = illegal case (Note 4)
9505     * <p>Notes:
9506     * <ol>
9507     *
9508     * <li> The equatorial radius, a, can be in any units, but meters is
9509     *     the conventional choice.
9510     *
9511     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9512     *     i.e. around 1/298.
9513     *
9514     * <li> The equatorial radius, a, and the height, height, must be
9515     *     given in the same units, and determine the units of the
9516     *     returned geocentric vector, xyz.
9517     *
9518     * <li> No validation is performed on individual arguments.  The error
9519     *     status -1 protects against (unrealistic) cases that would lead
9520     *     to arithmetic exceptions.  If an error occurs, xyz is unchanged.
9521     *
9522     * <li> The inverse transformation is performed in the function
9523     *     jauGc2gde.
9524     *
9525     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9526     *     more conveniently be performed by calling jauGd2gc,  which uses a
9527     *     numerical code (1 for WGS84) to identify the required a and f
9528     *     values.
9529     *</ol>
9530     *<p>References:
9531     *
9532     *     <p>Green, R.M., Spherical Astronomy, Cambridge University Press,
9533     *     (1985) Section 4.5, p96.
9534     *
9535     *     <p>Explanatory Supplement to the Astronomical Almanac,
9536     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
9537     *     Section 4.22, p202.
9538     *
9539     *@version 2009 November 2
9540     *
9541     *  @since Release 20101201
9542     *
9543     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9544     */
9545     public static double[] jauGd2gce ( double a, double f, double elong, double phi,
9546                     double height ) throws JSOFAInternalError
9547     {
9548        double sp, cp, w, d, ac, as, r;
9549        double xyz[] = new double[3];
9550 
9551 
9552     /* Functions of geodetic latitude. */
9553        sp = sin(phi);
9554        cp = cos(phi);
9555        w = 1.0 - f;
9556        w = w * w;
9557        d = cp*cp + w*sp*sp;
9558        if ( d <= 0.0 ) throw new JSOFAInternalError("illegal combination of arguments d< 0", -1);
9559        ac = a / sqrt(d);
9560        as = w * ac;
9561 
9562     /* Geocentric vector. */
9563        r = (ac + height) * cp;
9564        xyz[0] = r * cos(elong);
9565        xyz[1] = r * sin(elong);
9566        xyz[2] = (as + height) * sp;
9567 
9568     /* Success. */
9569        return xyz;
9570 
9571     
9572     }
9573     
9574 
9575     /**
9576     *  Greenwich mean sidereal time (model consistent with IAU 2000
9577     *  resolutions).
9578     *
9579     *<p>This function is derived from the International Astronomical Union's
9580     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9581     *
9582     *<p>Status:  canonical model.
9583     *
9584     *<!-- Given: -->
9585     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9586     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9587     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9588     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9589     *
9590     * <!-- Returned (function value): -->
9591     *  @return double    Greenwich mean sidereal time (radians)
9592     *
9593     * <p>Notes:
9594     * <ol>
9595     *
9596     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9597     *     Julian Dates, apportioned in any convenient way between the
9598     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9599     *     any of these ways, among others:
9600     *<pre>
9601     *            Part A         Part B
9602     *
9603     *         2450123.7           0.0       (JD method)
9604     *         2451545.0       -1421.3       (J2000 method)
9605     *         2400000.5       50123.2       (MJD method)
9606     *         2450123.5           0.2       (date &amp; time method)
9607     *</pre>
9608     *     The JD method is the most natural and convenient to use in
9609     *     cases where the loss of several decimal digits of resolution
9610     *     is acceptable (in the case of UT;  the TT is not at all critical
9611     *     in this respect).  The J2000 and MJD methods are good compromises
9612     *     between resolution and convenience.  For UT, the date &amp; time
9613     *     method is best matched to the algorithm that is used by the Earth
9614     *     Rotation Angle function, called internally:  maximum precision is
9615     *     delivered when the uta argument is for 0hrs UT1 on the day in
9616     *     question and the utb argument lies in the range 0 to 1, or vice
9617     *     versa.
9618     *
9619     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9620     *     and TT to predict the effects of precession.  If UT1 is used for
9621     *     both purposes, errors of order 100 microarcseconds result.
9622     *
9623     * <li> This GMST is compatible with the IAU 2000 resolutions and must be
9624     *     used only in conjunction with other IAU 2000 compatible
9625     *     components such as precession-nutation and equation of the
9626     *     equinoxes.
9627     *
9628     * <li> The result is returned in the range 0 to 2pi.
9629     *
9630     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9631     *     Conventions 2003.
9632     *</ol>
9633     *<p>Called:<ul>
9634     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9635     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9636     * </ul>
9637     *<p>References:
9638     *
9639     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9640     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9641     *     Astrophysics, 406, 1135-1149 (2003)
9642     *
9643     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9644     *     IERS Technical Note No. 32, BKG (2004)
9645     *
9646     *@version 2009 March 16
9647     *
9648     *  @since Release 20101201
9649     *
9650     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9651     */
9652     public static double jauGmst00(double uta, double utb, double tta, double ttb)
9653     {
9654        double t, gmst;
9655 
9656 
9657     /* TT Julian centuries since J2000.0. */
9658        t = ((tta - DJ00) + ttb) / DJC;
9659 
9660     /* Greenwich Mean Sidereal Time, IAU 2000. */
9661        gmst = jauAnp(jauEra00(uta, utb) +
9662                        (     0.014506   +
9663                        (  4612.15739966 +
9664                        (     1.39667721 +
9665                        (    -0.00009344 +
9666                        (     0.00001882 )
9667               * t) * t) * t) * t) * DAS2R);
9668 
9669        return gmst;
9670 
9671         }
9672     
9673 
9674     /**
9675     *  Greenwich mean sidereal time (consistent with IAU 2006 precession).
9676     *
9677     *<p>This function is derived from the International Astronomical Union's
9678     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9679     *
9680     *<p>Status:  canonical model.
9681     *
9682     *<!-- Given: -->
9683     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9684     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9685     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9686     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9687     *
9688     * <!-- Returned (function value): -->
9689     *  @return double    Greenwich mean sidereal time (radians)
9690     *
9691     * <p>Notes:
9692     * <ol>
9693     *
9694     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9695     *     Julian Dates, apportioned in any convenient way between the
9696     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9697     *     any of these ways, among others:
9698     *<pre>
9699     *            Part A        Part B
9700     *
9701     *         2450123.7           0.0       (JD method)
9702     *         2451545.0       -1421.3       (J2000 method)
9703     *         2400000.5       50123.2       (MJD method)
9704     *         2450123.5           0.2       (date &amp; time method)
9705     *</pre>
9706     *     The JD method is the most natural and convenient to use in
9707     *     cases where the loss of several decimal digits of resolution
9708     *     is acceptable (in the case of UT;  the TT is not at all critical
9709     *     in this respect).  The J2000 and MJD methods are good compromises
9710     *     between resolution and convenience.  For UT, the date &amp; time
9711     *     method is best matched to the algorithm that is used by the Earth
9712     *     rotation angle function, called internally:  maximum precision is
9713     *     delivered when the uta argument is for 0hrs UT1 on the day in
9714     *     question and the utb argument lies in the range 0 to 1, or vice
9715     *     versa.
9716     *
9717     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9718     *     and TT to predict the effects of precession.  If UT1 is used for
9719     *     both purposes, errors of order 100 microarcseconds result.
9720     *
9721     * <li> This GMST is compatible with the IAU 2006 precession and must not
9722     *     be used with other precession models.
9723     *
9724     * <li> The result is returned in the range 0 to 2pi.
9725     *</ol>
9726     *<p>Called:<ul>
9727     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9728     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9729     * </ul>
9730     *<p>Reference:
9731     *
9732     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2005,
9733     *     Astron.Astrophys. 432, 355
9734     *
9735     *@version 2008 May 24
9736     *
9737     *  @since Release 20101201
9738     *
9739     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9740     */
9741     public static double jauGmst06(double uta, double utb, double tta, double ttb)
9742     {
9743        double t, gmst;
9744 
9745 
9746     /* TT Julian centuries since J2000.0. */
9747        t = ((tta - DJ00) + ttb) / DJC;
9748 
9749     /* Greenwich mean sidereal time, IAU 2006. */
9750        gmst = jauAnp(jauEra00(uta, utb) +
9751                       (    0.014506     +
9752                       (  4612.156534    +
9753                       (     1.3915817   +
9754                       (    -0.00000044  +
9755                       (    -0.000029956 +
9756                       (    -0.0000000368 )
9757               * t) * t) * t) * t) * t) * DAS2R);
9758 
9759        return gmst;
9760 
9761         }
9762     
9763 
9764     /**
9765     *  Universal Time to Greenwich mean sidereal time (IAU 1982 model).
9766     *
9767     *<p>This function is derived from the International Astronomical Union's
9768     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9769     *
9770     *<p>Status:  canonical model.
9771     *
9772     *<!-- Given: -->
9773     *     @param dj1 double     UT1 Julian Date (see note)
9774     *     @param dj2 double     UT1 Julian Date (see note) 
9775     *
9776     * <!-- Returned (function value): -->
9777     *  @return double    Greenwich mean sidereal time (radians)
9778     *
9779     * <p>Notes:
9780     * <ol>
9781     *
9782     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
9783     *     convenient way between the arguments dj1 and dj2.  For example,
9784     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
9785     *     among others:
9786     *<pre>
9787     *             dj1            dj2
9788     *
9789     *         2450123.7D0        0D0        (JD method)
9790     *          2451545D0      -1421.3D0     (J2000 method)
9791     *         2400000.5D0     50123.2D0     (MJD method)
9792     *         2450123.5D0       0.2D0       (date &amp; time method)
9793     *</pre>
9794     *     The JD method is the most natural and convenient to use in
9795     *     cases where the loss of several decimal digits of resolution
9796     *     is acceptable.  The J2000 and MJD methods are good compromises
9797     *     between resolution and convenience.  The date &amp; time method is
9798     *     best matched to the algorithm used:  maximum accuracy (or, at
9799     *     least, minimum noise) is delivered when the dj1 argument is for
9800     *     0hrs UT1 on the day in question and the dj2 argument lies in the
9801     *     range 0 to 1, or vice versa.
9802     *
9803     * <li> The algorithm is based on the IAU 1982 expression.  This is
9804     *     always described as giving the GMST at 0 hours UT1.  In fact, it
9805     *     gives the difference between the GMST and the UT, the steady
9806     *     4-minutes-per-day drawing-ahead of ST with respect to UT.  When
9807     *     whole days are ignored, the expression happens to equal the GMST
9808     *     at 0 hours UT1 each day.
9809     *
9810     * <li> In this function, the entire UT1 (the sum of the two arguments
9811     *     dj1 and dj2) is used directly as the argument for the standard
9812     *     formula, the constant term of which is adjusted by 12 hours to
9813     *     take account of the noon phasing of Julian Date.  The UT1 is then
9814     *     added, but omitting whole days to conserve accuracy.
9815     *</ol>
9816     *<p>Called:<ul>
9817     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9818     * </ul>
9819     *<p>References:
9820     *
9821     *     <p>Transactions of the International Astronomical Union,
9822     *     XVIII B, 67 (1983).
9823     *
9824     *     <p>Aoki et al., Astron. Astrophys. 105, 359-361 (1982).
9825     *
9826     *@version 2008 May 24
9827     *
9828     *  @since Release 20101201
9829     *
9830     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9831     */
9832     public static double jauGmst82(double dj1, double dj2)
9833     {
9834     /* Coefficients of IAU 1982 GMST-UT1 model */
9835        double A = 24110.54841  -  DAYSEC / 2.0;
9836        double B = 8640184.812866;
9837        double C = 0.093104;
9838        double D =  -6.2e-6;
9839 
9840     /* Note: the first constant, A, has to be adjusted by 12 hours */
9841     /* because the UT1 is supplied as a Julian date, which begins  */
9842     /* at noon.                                                    */
9843 
9844        double d1, d2, t, f, gmst;
9845 
9846 
9847     /* Julian centuries since fundamental epoch. */
9848        if (dj1 < dj2) {
9849           d1 = dj1;
9850           d2 = dj2;
9851        } else {
9852           d1 = dj2;
9853           d2 = dj1;
9854        }
9855        t = (d1 + (d2 - DJ00)) / DJC;
9856 
9857     /* Fractional part of JD(UT1), in seconds. */
9858        f = DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
9859 
9860     /* GMST at this UT1. */
9861        gmst = jauAnp(DS2R * ((A + (B + (C + D * t) * t) * t) + f));
9862 
9863        return gmst;
9864 
9865         }
9866     
9867 
9868     /**
9869     *  Greenwich apparent sidereal time (consistent with IAU 2000
9870     *  resolutions).
9871     *
9872     *<p>This function is derived from the International Astronomical Union's
9873     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9874     *
9875     *<p>Status:  canonical model.
9876     *
9877     *<!-- Given: -->
9878     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9879     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9880     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9881     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9882     *
9883     * <!-- Returned (function value): -->
9884     *  @return double    Greenwich apparent sidereal time (radians)
9885     *
9886     * <p>Notes:
9887     * <ol>
9888     *
9889     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9890     *     Julian Dates, apportioned in any convenient way between the
9891     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9892     *     any of these ways, among others:
9893     *<pre>
9894     *            Part A        Part B
9895     *
9896     *         2450123.7           0.0       (JD method)
9897     *         2451545.0       -1421.3       (J2000 method)
9898     *         2400000.5       50123.2       (MJD method)
9899     *         2450123.5           0.2       (date &amp; time method)
9900     *</pre>
9901     *     The JD method is the most natural and convenient to use in
9902     *     cases where the loss of several decimal digits of resolution
9903     *     is acceptable (in the case of UT;  the TT is not at all critical
9904     *     in this respect).  The J2000 and MJD methods are good compromises
9905     *     between resolution and convenience.  For UT, the date &amp; time
9906     *     method is best matched to the algorithm that is used by the Earth
9907     *     Rotation Angle function, called internally:  maximum precision is
9908     *     delivered when the uta argument is for 0hrs UT1 on the day in
9909     *     question and the utb argument lies in the range 0 to 1, or vice
9910     *     versa.
9911     *
9912     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9913     *     and TT to predict the effects of precession-nutation.  If UT1 is
9914     *     used for both purposes, errors of order 100 microarcseconds
9915     *     result.
9916     *
9917     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
9918     *     used only in conjunction with other IAU 2000 compatible
9919     *     components such as precession-nutation.
9920     *
9921     * <li> The result is returned in the range 0 to 2pi.
9922     *
9923     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9924     *     Conventions 2003.
9925     *</ol>
9926     *<p>Called:<ul>
9927     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
9928     *     <li>{@link #jauEe00a} equation of the equinoxes, IAU 2000A
9929     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9930     * </ul>
9931     *<p>References:
9932     *
9933     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9934     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9935     *     Astrophysics, 406, 1135-1149 (2003)
9936     *
9937     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9938     *     IERS Technical Note No. 32, BKG (2004)
9939     *
9940     *@version 2008 May 16
9941     *
9942     *  @since Release 20101201
9943     *
9944     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9945     */
9946     public static double jauGst00a(double uta, double utb, double tta, double ttb)
9947     {
9948        double gmst00, ee00a, gst;
9949 
9950 
9951        gmst00 = jauGmst00(uta, utb, tta, ttb);
9952        ee00a = jauEe00a(tta, ttb);
9953        gst = jauAnp(gmst00 + ee00a);
9954 
9955        return gst;
9956 
9957         }
9958     
9959 
9960     /**
9961     *  Greenwich apparent sidereal time (consistent with IAU 2000
9962     *  resolutions but using the truncated nutation model IAU 2000B).
9963     *
9964     *<p>This function is derived from the International Astronomical Union's
9965     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9966     *
9967     *<p>Status:  support function.
9968     *
9969     *<!-- Given: -->
9970     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9971     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9972     *
9973     * <!-- Returned (function value): -->
9974     *  @return double    Greenwich apparent sidereal time (radians)
9975     *
9976     * <p>Notes:
9977     * <ol>
9978     *
9979     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
9980     *     convenient way between the argument pair.  For example,
9981     *     JD=2450123.7 could be expressed in any of these ways, among
9982     *     others:
9983     *<pre>
9984     *             uta            utb
9985     *
9986     *         2450123.7           0.0       (JD method)
9987     *         2451545.0       -1421.3       (J2000 method)
9988     *         2400000.5       50123.2       (MJD method)
9989     *         2450123.5           0.2       (date &amp; time method)
9990     *</pre>
9991     *     The JD method is the most natural and convenient to use in cases
9992     *     where the loss of several decimal digits of resolution is
9993     *     acceptable.  The J2000 and MJD methods are good compromises
9994     *     between resolution and convenience.  For UT, the date &amp; time
9995     *     method is best matched to the algorithm that is used by the Earth
9996     *     Rotation Angle function, called internally:  maximum precision is
9997     *     delivered when the uta argument is for 0hrs UT1 on the day in
9998     *     question and the utb argument lies in the range 0 to 1, or vice
9999     *     versa.
10000     *
10001     * <li> The result is compatible with the IAU 2000 resolutions, except
10002     *     that accuracy has been compromised for the sake of speed and
10003     *     convenience in two respects:
10004     *
10005     *     . UT is used instead of TDB (or TT) to compute the precession
10006     *       component of GMST and the equation of the equinoxes.  This
10007     *       results in errors of order 0.1 mas at present.
10008     *
10009     *     . The IAU 2000B abridged nutation model (McCarthy &amp; Luzum, 2001)
10010     *       is used, introducing errors of up to 1 mas.
10011     *
10012     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
10013     *     used only in conjunction with other IAU 2000 compatible
10014     *     components such as precession-nutation.
10015     *
10016     * <li> The result is returned in the range 0 to 2pi.
10017     *
10018     * <li> The algorithm is from Capitaine et al. (2003) and IERS
10019     *     Conventions 2003.
10020     *</ol>
10021     *<p>Called:<ul>
10022     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
10023     *     <li>{@link #jauEe00b} equation of the equinoxes, IAU 2000B
10024     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10025     * </ul>
10026     *<p>References:
10027     *
10028     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
10029     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
10030     *     Astrophysics, 406, 1135-1149 (2003)
10031     *
10032     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
10033     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
10034     *     Dynamical Astronomy, 85, 37-49 (2003)
10035     *
10036     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
10037     *     IERS Technical Note No. 32, BKG (2004)
10038     *
10039     *@version 2008 May 16
10040     *
10041     *  @since Release 20101201
10042     *
10043     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10044     */
10045     public static double jauGst00b(double uta, double utb)
10046     {
10047        double gmst00, ee00b, gst;
10048 
10049 
10050        gmst00 = jauGmst00(uta, utb, uta, utb);
10051        ee00b = jauEe00b(uta, utb);
10052        gst = jauAnp(gmst00 + ee00b);
10053 
10054        return gst;
10055 
10056         }
10057     
10058 
10059     /**
10060     *  Greenwich apparent sidereal time, IAU 2006, given the NPB matrix.
10061     *
10062     *<p>This function is derived from the International Astronomical Union's
10063     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10064     *
10065     *<p>Status:  support function.
10066     *
10067     *<!-- Given: -->
10068     *     @param uta double         UT1 as a 2-part Julian Date (Notes 1,2)
10069     *     @param utb double         UT1 as a 2-part Julian Date (Notes 1,2) 
10070     *     @param tta double         TT as a 2-part Julian Date (Notes 1,2)
10071     *     @param ttb double         TT as a 2-part Julian Date (Notes 1,2) 
10072     *     @param rnpb      double[3][3]   nutation x precession x bias matrix
10073     *
10074     * <!-- Returned (function value): -->
10075     *  @return double        Greenwich apparent sidereal time (radians)
10076     *
10077     * <p>Notes:
10078     * <ol>
10079     *
10080     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10081     *     Julian Dates, apportioned in any convenient way between the
10082     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10083     *     any of these ways, among others:
10084     *<pre>
10085     *            Part A        Part B
10086     *
10087     *         2450123.7           0.0       (JD method)
10088     *         2451545.0       -1421.3       (J2000 method)
10089     *         2400000.5       50123.2       (MJD method)
10090     *         2450123.5           0.2       (date &amp; time method)
10091     *</pre>
10092     *     The JD method is the most natural and convenient to use in
10093     *     cases where the loss of several decimal digits of resolution
10094     *     is acceptable (in the case of UT;  the TT is not at all critical
10095     *     in this respect).  The J2000 and MJD methods are good compromises
10096     *     between resolution and convenience.  For UT, the date &amp; time
10097     *     method is best matched to the algorithm that is used by the Earth
10098     *     rotation angle function, called internally:  maximum precision is
10099     *     delivered when the uta argument is for 0hrs UT1 on the day in
10100     *     question and the utb argument lies in the range 0 to 1, or vice
10101     *     versa.
10102     *
10103     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10104     *     and TT to predict the effects of precession-nutation.  If UT1 is
10105     *     used for both purposes, errors of order 100 microarcseconds
10106     *     result.
10107     *
10108     * <li> Although the function uses the IAU 2006 series for s+XY/2, it is
10109     *     otherwise independent of the precession-nutation model and can in
10110     *     practice be used with any equinox-based NPB matrix.
10111     *
10112     * <li> The result is returned in the range 0 to 2pi.
10113     *</ol>
10114     *<p>Called:<ul>
10115     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
10116     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
10117     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10118     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
10119     *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
10120     * </ul>
10121     *<p>Reference:
10122     *
10123     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10124     *
10125     *@version 2008 May 24
10126     *
10127     *  @since Release 20101201
10128     *
10129     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10130     */
10131     public static double jauGst06(double uta, double utb, double tta, double ttb,
10132                     double rnpb[][])
10133     {
10134        double s, era, eors, gst;
10135 
10136 
10137     /* Extract CIP coordinates. */
10138        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
10139 
10140     /* The CIO locator, s. */
10141        s = jauS06(tta, ttb, cip.x, cip.y);
10142 
10143     /* Greenwich apparent sidereal time. */
10144        era = jauEra00(uta, utb);
10145        eors = jauEors(rnpb, s);
10146        gst = jauAnp(era - eors);
10147 
10148        return gst;
10149 
10150         }
10151     
10152 
10153     /**
10154     *  Greenwich apparent sidereal time (consistent with IAU 2000 and 2006
10155     *  resolutions).
10156     *
10157     *<p>This function is derived from the International Astronomical Union's
10158     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10159     *
10160     *<p>Status:  canonical model.
10161     *
10162     *<!-- Given: -->
10163     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10164     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10165     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
10166     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
10167     *
10168     * <!-- Returned (function value): -->
10169     *  @return double    Greenwich apparent sidereal time (radians)
10170     *
10171     * <p>Notes:
10172     * <ol>
10173     *
10174     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10175     *     Julian Dates, apportioned in any convenient way between the
10176     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10177     *     any of these ways, among others:
10178     *<pre>
10179     *            Part A        Part B
10180     *
10181     *         2450123.7           0.0       (JD method)
10182     *         2451545.0       -1421.3       (J2000 method)
10183     *         2400000.5       50123.2       (MJD method)
10184     *         2450123.5           0.2       (date &amp; time method)
10185     *</pre>
10186     *     The JD method is the most natural and convenient to use in
10187     *     cases where the loss of several decimal digits of resolution
10188     *     is acceptable (in the case of UT;  the TT is not at all critical
10189     *     in this respect).  The J2000 and MJD methods are good compromises
10190     *     between resolution and convenience.  For UT, the date &amp; time
10191     *     method is best matched to the algorithm that is used by the Earth
10192     *     rotation angle function, called internally:  maximum precision is
10193     *     delivered when the uta argument is for 0hrs UT1 on the day in
10194     *     question and the utb argument lies in the range 0 to 1, or vice
10195     *     versa.
10196     *
10197     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10198     *     and TT to predict the effects of precession-nutation.  If UT1 is
10199     *     used for both purposes, errors of order 100 microarcseconds
10200     *     result.
10201     *
10202     * <li> This GAST is compatible with the IAU 2000/2006 resolutions and
10203     *     must be used only in conjunction with IAU 2006 precession and
10204     *     IAU 2000A nutation.
10205     *
10206     * <li> The result is returned in the range 0 to 2pi.
10207     *</ol>
10208     *<p>Called:<ul>
10209     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
10210     *     <li>{@link #jauGst06} Greenwich apparent ST, IAU 2006, given NPB matrix
10211     * </ul>
10212     *<p>Reference:
10213     *
10214     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10215     *
10216     *@version 2008 May 16
10217     *
10218     *  @since Release 20101201
10219     *
10220     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10221     */
10222     public static double jauGst06a(double uta, double utb, double tta, double ttb)
10223     {
10224        double rnpb[][] = new double[3][3], gst;
10225 
10226 
10227     /* Classical nutation x precession x bias matrix, IAU 2000A. */
10228        rnpb = jauPnm06a(tta, ttb);
10229 
10230     /* Greenwich apparent sidereal time. */
10231        gst = jauGst06(uta, utb, tta, ttb, rnpb);
10232 
10233        return gst;
10234 
10235         }
10236     
10237 
10238     /**
10239     *  Greenwich apparent sidereal time (consistent with IAU 1982/94
10240     *  resolutions).
10241     *
10242     *<p>This function is derived from the International Astronomical Union's
10243     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10244     *
10245     *<p>Status:  support function.
10246     *
10247     *<!-- Given: -->
10248     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10249     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10250     *
10251     * <!-- Returned (function value): -->
10252     *  @return double    Greenwich apparent sidereal time (radians)
10253     *
10254     * <p>Notes:
10255     * <ol>
10256     *
10257     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
10258     *     convenient way between the argument pair.  For example,
10259     *     JD=2450123.7 could be expressed in any of these ways, among
10260     *     others:
10261     *<pre>
10262     *             uta            utb
10263     *
10264     *         2450123.7           0.0       (JD method)
10265     *         2451545.0       -1421.3       (J2000 method)
10266     *         2400000.5       50123.2       (MJD method)
10267     *         2450123.5           0.2       (date &amp; time method)
10268     *</pre>
10269     *     The JD method is the most natural and convenient to use in cases
10270     *     where the loss of several decimal digits of resolution is
10271     *     acceptable.  The J2000 and MJD methods are good compromises
10272     *     between resolution and convenience.  For UT, the date &amp; time
10273     *     method is best matched to the algorithm that is used by the Earth
10274     *     Rotation Angle function, called internally:  maximum precision is
10275     *     delivered when the uta argument is for 0hrs UT1 on the day in
10276     *     question and the utb argument lies in the range 0 to 1, or vice
10277     *     versa.
10278     *
10279     * <li> The result is compatible with the IAU 1982 and 1994 resolutions,
10280     *     except that accuracy has been compromised for the sake of
10281     *     convenience in that UT is used instead of TDB (or TT) to compute
10282     *     the equation of the equinoxes.
10283     *
10284     * <li> This GAST must be used only in conjunction with contemporaneous
10285     *     IAU standards such as 1976 precession, 1980 obliquity and 1982
10286     *     nutation.  It is not compatible with the IAU 2000 resolutions.
10287     *
10288     * <li> The result is returned in the range 0 to 2pi.
10289     *</ol>
10290     *<p>Called:<ul>
10291     *     <li>{@link #jauGmst82} Greenwich mean sidereal time, IAU 1982
10292     *     <li>{@link #jauEqeq94} equation of the equinoxes, IAU 1994
10293     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10294     * </ul>
10295     *<p>References:
10296     *
10297     *     <p>Explanatory Supplement to the Astronomical Almanac,
10298     *     P. Kenneth Seidelmann (ed), University Science Books (1992)
10299     *
10300     *     IAU Resolution C7, Recommendation 3 (1994)
10301     *
10302     *@version 2008 May 16
10303     *
10304     *  @since Release 20101201
10305     *
10306     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10307     */
10308     public static double jauGst94(double uta, double utb)
10309     {
10310        double gmst82, eqeq94, gst;
10311 
10312 
10313        gmst82 = jauGmst82(uta, utb);
10314        eqeq94 = jauEqeq94(uta, utb);
10315        gst = jauAnp(gmst82  + eqeq94);
10316 
10317        return gst;
10318 
10319         }
10320     
10321 
10322     /**
10323     *  Transform Hipparcos star data into the FK5 (J2000.0) system.
10324     *
10325     *<p>This function is derived from the International Astronomical Union's
10326     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10327     *
10328     *<p>Status:  support function.
10329     *
10330     *  Given (all Hipparcos, epoch J2000.0):
10331     *    @param rh      double    RA (radians)
10332     *    @param dh      double    Dec (radians)
10333     *    @param drh     double    proper motion in RA (dRA/dt, rad/Jyear)
10334     *    @param ddh     double    proper motion in Dec (dDec/dt, rad/Jyear)
10335     *    @param pxh     double    parallax (arcsec)
10336     *    @param rvh     double    radial velocity (km/s, positive = receding)
10337     *
10338     *  @return  (all FK5, equinox J2000.0, epoch J2000.0):
10339     *
10340     * <p>Notes:
10341     * <ol>
10342     *
10343     * <li> This function transforms Hipparcos star positions and proper
10344     *     motions into FK5 J2000.0.
10345     *
10346     * <li> The proper motions in RA are dRA/dt rather than
10347     *     cos(Dec)*dRA/dt, and are per year rather than per century.
10348     *
10349     * <li> The FK5 to Hipparcos transformation is modeled as a pure
10350     *     rotation and spin;  zonal errors in the FK5 catalog are not
10351     *     taken into account.
10352     *
10353     * <li> See also jauFk52h, jauFk5hz, jauHfk5z.
10354     *</ol>
10355     *<p>Called:<ul>
10356     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
10357     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10358     *     <li>{@link #jauRv2m} r-vector to r-matrix
10359     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10360     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10361     *     <li>{@link #jauPxp} vector product of two p-vectors
10362     *     <li>{@link #jauPmp} p-vector minus p-vector
10363     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
10364     * </ul>
10365     *<p>Reference:
10366     *
10367     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
10368     *
10369     *@version 2009 December 17
10370     *
10371     *  @since Release 20101201
10372     *
10373     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10374     */
10375     public static CatalogCoords jauH2fk5(double rh, double dh,
10376                   double drh, double ddh, double pxh, double rvh)
10377     {
10378        int i;
10379        double pvh[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pv5[][] = new double[2][3];
10380 
10381 
10382     /* Hipparcos barycentric position/velocity pv-vector (normalized). */
10383        jauStarpv(rh, dh, drh, ddh, pxh, rvh, pvh);
10384 
10385     /* FK5 to Hipparcos orientation matrix and spin vector. */
10386        jauFk5hip(r5h, s5h);
10387 
10388     /* Make spin units per day instead of per year. */
10389        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
10390 
10391     /* Orient the spin into the Hipparcos system. */
10392        sh = jauRxp(r5h, s5h);
10393 
10394     /* De-orient the Hipparcos position into the FK5 system. */
10395        pv5[0] = jauTrxp(r5h, pvh[0]);
10396 
10397     /* Apply spin to the position giving an extra space motion component. */
10398        wxp = jauPxp(pvh[0],sh);
10399 
10400     /* Subtract this component from the Hipparcos space motion. */
10401        vv = jauPmp(pvh[1], wxp);
10402 
10403     /* De-orient the Hipparcos space motion into the FK5 system. */
10404        pv5[1] = jauTrxp(r5h, vv);
10405 
10406     /* FK5 pv-vector to spherical., r5, d5, dr5, dd5, px5, rv5 */
10407        CatalogCoords cat = null;
10408        try {
10409            cat = jauPvstar(pv5);
10410        } catch (JSOFAInternalError e) {
10411            // original code just ignored this possibility
10412            e.printStackTrace();
10413        }
10414 
10415        return cat;
10416 
10417         }
10418     
10419 
10420     /**
10421     *  Transform a Hipparcos star position into FK5 J2000.0, assuming
10422     *  zero Hipparcos proper motion.
10423     *
10424     *<p>This function is derived from the International Astronomical Union's
10425     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10426     *
10427     *<p>Status:  support function.
10428     *
10429     *<!-- Given: -->
10430     *     @param rh             double     Hipparcos RA (radians)
10431     *     @param dh             double     Hipparcos Dec (radians)
10432     *     @param date1 double     TDB date (Note 1)
10433     *     @param date2 double     TDB date (Note 1) 
10434     *
10435     * FIXME original did not return the parallax and radial velocity of the CatalogCoords type.
10436     *  Returned (all FK5, equinox J2000.0, date date1+date2):
10437     *     r5            double    RA (radians)
10438     *     d5            double    Dec (radians)
10439     *     dr5           double    FK5 RA proper motion (rad/year, Note 4)
10440     *     dd5           double    Dec proper motion (rad/year, Note 4)
10441     *
10442     * <p>Notes:
10443     * <ol>
10444     *
10445     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10446     *     convenient way between the two arguments.  For example,
10447     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10448     *     among others:
10449     *<pre>
10450     *            date1          date2
10451     *
10452     *         2450123.7           0.0       (JD method)
10453     *         2451545.0       -1421.3       (J2000 method)
10454     *         2400000.5       50123.2       (MJD method)
10455     *         2450123.5           0.2       (date &amp; time method)
10456     *</pre>
10457     *     The JD method is the most natural and convenient to use in
10458     *     cases where the loss of several decimal digits of resolution
10459     *     is acceptable.  The J2000 method is best matched to the way
10460     *     the argument is handled internally and will deliver the
10461     *     optimum resolution.  The MJD method and the date &amp; time methods
10462     *     are both good compromises between resolution and convenience.
10463     *
10464     * <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
10465     *
10466     * <li> The FK5 to Hipparcos transformation is modeled as a pure rotation
10467     *     and spin;  zonal errors in the FK5 catalogue are not taken into
10468     *     account.
10469     *
10470     * <li> It was the intention that Hipparcos should be a close
10471     *     approximation to an inertial frame, so that distant objects have
10472     *     zero proper motion;  such objects have (in general) non-zero
10473     *     proper motion in FK5, and this function returns those fictitious
10474     *     proper motions.
10475     *
10476     * <li> The position returned by this function is in the FK5 J2000.0
10477     *     reference system but at date date1+date2.
10478     *
10479     * <li> See also jauFk52h, jauH2fk5, jauFk5zhz.
10480     *</ol>
10481     *<p>Called:<ul>
10482     *     <li>{@link #jauS2c} spherical coordinates to unit vector
10483     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10484     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10485     *     <li>{@link #jauSxp} multiply p-vector by scalar
10486     *     <li>{@link #jauRxr} product of two r-matrices
10487     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10488     *     <li>{@link #jauPxp} vector product of two p-vectors
10489     *     <li>{@link #jauPv2s} pv-vector to spherical
10490     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10491     * </ul>
10492     *<p>Reference:
10493     *
10494     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
10495     *
10496     *@version 2009 December 17
10497     *
10498     *  @since Release 20101201
10499     *
10500     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10501     *
10502     */
10503     public static CatalogCoords jauHfk5z(double rh, double dh, double date1, double date2)
10504     {
10505        double t, ph[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], vst[] = new double[3],
10506        rst[][] = new double[3][3], r5ht[][] = new double[3][3], pv5e[][] = new double[2][3], vv[] = new double[3];
10507 
10508 
10509     /* Time interval from fundamental epoch J2000.0 to given date (JY). */
10510        t = ((date1 - DJ00) + date2) / DJY;
10511 
10512     /* Hipparcos barycentric position vector (normalized). */
10513        ph = jauS2c(rh,dh);
10514 
10515     /* FK5 to Hipparcos orientation matrix and spin vector. */
10516        jauFk5hip(r5h, s5h);
10517 
10518     /* Rotate the spin into the Hipparcos system. */
10519        sh = jauRxp(r5h, s5h);
10520 
10521     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
10522        vst = jauSxp(t,s5h);
10523 
10524     /* Express the accumulated spin as a rotation matrix. */
10525        rst = jauRv2m(vst);
10526 
10527     /* Rotation matrix:  accumulated spin, then FK5 to Hipparcos. */
10528        r5ht = jauRxr(r5h, rst);
10529 
10530     /* De-orient &amp; de-spin the Hipparcos position into FK5 J2000.0. */
10531        pv5e[0] = jauTrxp(r5ht, ph);
10532 
10533     /* Apply spin to the position giving a space motion. */
10534        vv = jauPxp(sh,ph);
10535 
10536     /* De-orient &amp; de-spin the Hipparcos space motion into FK5 J2000.0. */
10537        pv5e[1] = jauTrxp(r5ht, vv);
10538 
10539     /* FK5 position/velocity pv-vector to spherical. */
10540        SphericalPositionVelocity pvs = jauPv2s(pv5e);
10541        double r5 = jauAnp(pvs.pos.theta);
10542 
10543        return new CatalogCoords(r5, pvs.pos.phi, pvs.vel.theta, pvs.vel.phi, 0.0, 0.0);
10544 
10545         }
10546     
10547 
10548     /**
10549     *  Initialize an r-matrix to the identity matrix.
10550     *
10551     *<p>This function is derived from the International Astronomical Union's
10552     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10553     *
10554     *<p>Status:  vector/matrix support function.
10555     *
10556     *<!-- Returned: -->
10557     *     @param r        double[3][3]      <u>returned</u> r-matrix
10558     *
10559     *<p>Called:<ul>
10560     *     <li>{@link #jauZr} zero r-matrix
10561     * </ul>
10562     *@version 2008 May 11
10563     *
10564     *  @since Release 20101201
10565     *
10566     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10567     */
10568     public static void jauIr(double r[][])
10569     {
10570        jauZr(r);
10571        r[0][0] = 1.0;
10572        r[1][1] = 1.0;
10573        r[2][2] = 1.0;
10574 
10575        return;
10576 
10577         }
10578     
10579 
10580     /**
10581     *  Julian Date to Gregorian year, month, day, and fraction of a day.
10582     *
10583     *<p>This function is derived from the International Astronomical Union's
10584     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10585     *
10586     *<p>Status:  support function.
10587     *
10588     *<!-- Given: -->
10589     *     @param dj1 double    Julian Date (Notes 1, 2)
10590     *     @param dj2 double    Julian Date (Notes 1, 2) 
10591     *
10592     *  Returned (arguments):
10593     *     iy        int      year
10594     *     im        int      month
10595     *     id        int      day
10596     *     fd        double   fraction of day
10597     *
10598     * <!-- Returned (function value): -->
10599     *  @return int      status:
10600     *                           0 = OK
10601     *                          -1 = unacceptable date (Note 3)
10602     *
10603     * <p>Notes:
10604     * <ol>
10605     *
10606     * <li> The earliest valid date is -68569.5 (-4900 March 1).  The
10607     *     largest value accepted is 10^9.
10608     *
10609     * <li> The Julian Date is apportioned in any convenient way between
10610     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10611     *     be expressed in any of these ways, among others:
10612     *<pre>
10613     *            dj1             dj2
10614     *
10615     *         2450123.7           0.0       (JD method)
10616     *         2451545.0       -1421.3       (J2000 method)
10617     *         2400000.5       50123.2       (MJD method)
10618     *         2450123.5           0.2       (date &amp; time method)
10619     *</pre>
10620     * <li> In early eras the conversion is from the "proleptic Gregorian
10621     *     calendar";  no account is taken of the date(s) of adoption of
10622     *     the Gregorian calendar, nor is the AD/BC numbering convention
10623     *     observed.
10624     *</ol>
10625     *<p>Reference:
10626     *
10627     *     <p>Explanatory Supplement to the Astronomical Almanac,
10628     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10629     *     Section 12.92 (p604).
10630     *
10631     *@version 2008 May 26
10632     *
10633     *  @since Release 20101201
10634     *
10635     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10636     */
10637     public static Calendar jauJd2cal(double dj1, double dj2) throws JSOFAIllegalParameter
10638     {
10639     /* Minimum and maximum allowed JD */
10640        final double djmin = -68569.5;
10641        final double djmax = 1e9;
10642 
10643        long jd, l, n, i, k;
10644        double dj, d1, d2, f1, f2, f, d;
10645 
10646 
10647     /* Verify date is acceptable. */
10648        dj = dj1 + dj2;
10649        if (dj < djmin || dj > djmax) throw new JSOFAIllegalParameter("input julian date out of range", -1);
10650 
10651     /* Copy the date, big then small, and re-align to midnight. */
10652        if (dj1 >= dj2) {
10653           d1 = dj1;
10654           d2 = dj2;
10655        } else {
10656           d1 = dj2;
10657           d2 = dj1;
10658        }
10659        d2 -= 0.5;
10660 
10661     /* Separate day and fraction. */
10662        f1 = fmod(d1, 1.0);
10663        f2 = fmod(d2, 1.0);
10664        f = fmod(f1 + f2, 1.0);
10665        if (f < 0.0) f += 1.0;
10666        d = floor(d1 - f1) + floor(d2 - f2) + floor(f1 + f2 - f);
10667        jd = (long) floor(d) + 1L;
10668 
10669     /* Express day in Gregorian calendar. */
10670        l = jd + 68569L;
10671        n = (4L * l) / 146097L;
10672        l -= (146097L * n + 3L) / 4L;
10673        i = (4000L * (l + 1L)) / 1461001L;
10674        l -= (1461L * i) / 4L - 31L;
10675        k = (80L * l) / 2447L;
10676        int id = (int) (l - (2447L * k) / 80L);
10677        l = k / 11L;
10678        int im = (int) (k + 2L - 12L * l);
10679        int iy = (int) (100L * (n - 49L) + i + l);
10680       
10681 
10682        return new Calendar(iy, im, id, f);
10683 
10684         }
10685      
10686     /**
10687     *  Julian Date to Gregorian Calendar, expressed in a form convenient
10688     *  for formatting messages:  rounded to a specified precision.
10689     *
10690     *<p>This function is derived from the International Astronomical Union's
10691     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10692     *
10693     *<p>Status:  support function.
10694     *
10695     *<!-- Given: -->
10696     *     @param ndp        int       number of decimal places of days in fraction
10697     *     @param dj1 double    dj1+dj2 = Julian Date (Note 1)
10698     *     @param dj2 double    dj1+dj2 = Julian Date (Note 1) 
10699     *
10700     *<!-- Returned: -->
10701     *     @param iymdf      int[4]     <u>returned</u> year, month, day, fraction in Gregorian calendar
10702     *
10703     *
10704     * <!-- Returned (function value): -->
10705     *  @return int      status:
10706     *                          -1 = date out of range
10707     *                           0 = OK
10708     *                          +1 = NDP not 0-9 (interpreted as 0)
10709     *
10710     * <p>Notes:
10711     * <ol>
10712     *
10713     * <li> The Julian Date is apportioned in any convenient way between
10714     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10715     *     be expressed in any of these ways, among others:
10716     *<pre>
10717     *             dj1            dj2
10718     *
10719     *         2450123.7           0.0       (JD method)
10720     *         2451545.0       -1421.3       (J2000 method)
10721     *         2400000.5       50123.2       (MJD method)
10722     *         2450123.5           0.2       (date &amp; time method)
10723     *</pre>
10724     * <li> In early eras the conversion is from the "Proleptic Gregorian
10725     *     Calendar";  no account is taken of the date(s) of adoption of
10726     *     the Gregorian Calendar, nor is the AD/BC numbering convention
10727     *     observed.
10728     *
10729     * <li> Refer to the function jauJd2cal.
10730     *
10731     * <li> NDP should be 4 or less if internal overflows are to be
10732     *     avoided on machines which use 16-bit integers.
10733     *</ol>
10734     *<p>Called:<ul>
10735     *     <li>{@link #jauJd2cal} JD to Gregorian calendar
10736     * </ul>
10737     *<p>Reference:
10738     *
10739     *     <p>Explanatory Supplement to the Astronomical Almanac,
10740     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10741     *     Section 12.92 (p604).
10742     *
10743     *@version 2008 October 28
10744     *
10745     *  @since Release 20101201
10746     *
10747     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10748     */
10749     public static int jauJdcalf(int ndp, double dj1, double dj2, int iymdf[])
10750     {
10751        int j;
10752        double denom, d1, d2, f1, f2, f;
10753 
10754 
10755     /* Denominator of fraction (e.g. 100 for 2 decimal places). */
10756        if ((ndp >= 0) && (ndp <= 9)) {
10757           j = 0;
10758           denom = pow(10.0, ndp);
10759        } else {
10760           j = 1;
10761           denom = 1.0;
10762        }
10763 
10764     /* Copy the date, big then small, and realign to midnight. */
10765        if (dj1 >= dj2) {
10766           d1 = dj1;
10767           d2 = dj2;
10768        } else {
10769           d1 = dj2;
10770           d2 = dj1;
10771        }
10772        d2 -= 0.5;
10773 
10774     /* Separate days and fractions. */
10775        f1 = fmod(d1, 1.0);
10776        f2 = fmod(d2, 1.0);
10777        d1 = floor(d1 - f1);
10778        d2 = floor(d2 - f2);
10779 
10780     /* Round the total fraction to the specified number of places. */
10781        f = floor((f1 + f2) * denom) / denom;
10782 
10783     /* Re-assemble the rounded date and re-align to noon. */
10784        d2 += f + 0.5;
10785 
10786        /* Convert to Gregorian Calendar. */
10787        try {
10788            Calendar cal = jauJd2cal(d1, d2);
10789            iymdf[0] = cal.iy;
10790            iymdf[1] = cal.im;
10791            iymdf[2] = cal.id;
10792            iymdf[3] = (int) (cal.fd * denom);
10793        } catch (JSOFAIllegalParameter e) {
10794            j = -1;
10795        }
10796 
10797     /* Return the status. */
10798        return j;
10799 
10800         }
10801     
10802 
10803     /**
10804     *  Form the matrix of nutation for a given date, IAU 2000A model.
10805     *
10806     *<p>This function is derived from the International Astronomical Union's
10807     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10808     *
10809     *<p>Status:  support function.
10810     *
10811     *<!-- Given: -->
10812     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10813     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10814     *
10815     *<!-- Returned: -->
10816     *     @return rmatn         double[3][3]      <u>returned</u> nutation matrix
10817     *
10818     * <p>Notes:
10819     * <ol>
10820     *
10821     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10822     *     convenient way between the two arguments.  For example,
10823     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10824     *     among others:
10825     *<pre>
10826     *            date1          date2
10827     *
10828     *         2450123.7           0.0       (JD method)
10829     *         2451545.0       -1421.3       (J2000 method)
10830     *         2400000.5       50123.2       (MJD method)
10831     *         2450123.5           0.2       (date &amp; time method)
10832     *</pre>
10833     *     The JD method is the most natural and convenient to use in
10834     *     cases where the loss of several decimal digits of resolution
10835     *     is acceptable.  The J2000 method is best matched to the way
10836     *     the argument is handled internally and will deliver the
10837     *     optimum resolution.  The MJD method and the date &amp; time methods
10838     *     are both good compromises between resolution and convenience.
10839     *
10840     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10841     *     the p-vector V(true) is with respect to the true equatorial triad
10842     *     of date and the p-vector V(mean) is with respect to the mean
10843     *     equatorial triad of date.
10844     *
10845     * <li> A faster, but slightly less accurate result (about 1 mas), can be
10846     *     obtained by using instead the jauNum00b function.
10847     *</ol>
10848     *<p>Called:<ul>
10849     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
10850     * </ul>
10851     *<p>Reference:
10852     *
10853     *     <p>Explanatory Supplement to the Astronomical Almanac,
10854     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10855     *     Section 3.222-3 (p114).
10856     *
10857     *@version 2008 May 12
10858     *
10859     *  @since Release 20101201
10860     *
10861     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10862     */
10863     public static double[][] jauNum00a(double date1, double date2)
10864     {
10865 
10866     /* Obtain the required matrix (discarding other results). */
10867        PrecessionNutation pn = jauPn00a(date1, date2);
10868 
10869        return pn.rn ;
10870 
10871         }
10872     
10873 
10874     /**
10875     *  Form the matrix of nutation for a given date, IAU 2000B model.
10876     *
10877     *<p>This function is derived from the International Astronomical Union's
10878     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10879     *
10880     *<p>Status:  support function.
10881     *
10882     *<!-- Given: -->
10883     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10884     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10885     *
10886     *<!-- Returned: -->
10887     *     @return rmatn         double[3][3]     <u>returned</u> nutation matrix
10888     *
10889     * <p>Notes:
10890     * <ol>
10891     *
10892     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10893     *     convenient way between the two arguments.  For example,
10894     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10895     *     among others:
10896     *<pre>
10897     *            date1          date2
10898     *
10899     *         2450123.7           0.0       (JD method)
10900     *         2451545.0       -1421.3       (J2000 method)
10901     *         2400000.5       50123.2       (MJD method)
10902     *         2450123.5           0.2       (date &amp; time method)
10903     *</pre>
10904     *     The JD method is the most natural and convenient to use in
10905     *     cases where the loss of several decimal digits of resolution
10906     *     is acceptable.  The J2000 method is best matched to the way
10907     *     the argument is handled internally and will deliver the
10908     *     optimum resolution.  The MJD method and the date &amp; time methods
10909     *     are both good compromises between resolution and convenience.
10910     *
10911     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10912     *     the p-vector V(true) is with respect to the true equatorial triad
10913     *     of date and the p-vector V(mean) is with respect to the mean
10914     *     equatorial triad of date.
10915     *
10916     * <li> The present function is faster, but slightly less accurate (about
10917     *     1 mas), than the jauNum00a function.
10918     *</ol>
10919     *<p>Called:<ul>
10920     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
10921     * </ul>
10922     *<p>Reference:
10923     *
10924     *     <p>Explanatory Supplement to the Astronomical Almanac,
10925     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10926     *     Section 3.222-3 (p114).
10927     *
10928     *@version 2008 May 12
10929     *
10930     *  @since Release 20101201
10931     *
10932     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10933     */
10934     public static double[][] jauNum00b(double date1, double date2)
10935     {
10936 
10937     /* Obtain the required matrix (discarding other results). */
10938        PrecessionNutation pn = jauPn00b(date1, date2);
10939  
10940        return pn.rn;
10941 
10942     }
10943     
10944 
10945     /**
10946     *  Form the matrix of nutation for a given date, IAU 2006/2000A model.
10947     *
10948     *<p>This function is derived from the International Astronomical Union's
10949     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10950     *
10951     *<p>Status:  support function.
10952     *
10953     *<!-- Given: -->
10954     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10955     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10956     *
10957     *<!-- Returned: -->
10958     *     @return rmatn          double[3][3]      <u>returned</u> nutation matrix
10959     *
10960     * <p>Notes:
10961     * <ol>
10962     *
10963     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10964     *     convenient way between the two arguments.  For example,
10965     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10966     *     among others:
10967     *<pre>
10968     *            date1          date2
10969     *
10970     *         2450123.7           0.0       (JD method)
10971     *         2451545.0       -1421.3       (J2000 method)
10972     *         2400000.5       50123.2       (MJD method)
10973     *         2450123.5           0.2       (date &amp; time method)
10974     *</pre>
10975     *     The JD method is the most natural and convenient to use in
10976     *     cases where the loss of several decimal digits of resolution
10977     *     is acceptable.  The J2000 method is best matched to the way
10978     *     the argument is handled internally and will deliver the
10979     *     optimum resolution.  The MJD method and the date &amp; time methods
10980     *     are both good compromises between resolution and convenience.
10981     *
10982     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10983     *     the p-vector V(true) is with respect to the true equatorial triad
10984     *     of date and the p-vector V(mean) is with respect to the mean
10985     *     equatorial triad of date.
10986     *</ol>
10987     *<p>Called:<ul>
10988     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
10989     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
10990     *     <li>{@link #jauNumat} form nutation matrix
10991     * </ul>
10992     *<p>Reference:
10993     *
10994     *     <p>Explanatory Supplement to the Astronomical Almanac,
10995     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10996     *     Section 3.222-3 (p114).
10997     *
10998     *@version 2008 May 12
10999     *
11000     *  @since Release 20101201
11001     *
11002     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11003     */
11004     public static double[][] jauNum06a(double date1, double date2)
11005     {
11006        double eps, rmatn[][];
11007 
11008 
11009     /* Mean obliquity. */
11010        eps = jauObl06(date1, date2);
11011 
11012     /* Nutation components. */
11013        NutationTerms nut = jauNut06a(date1, date2);
11014 
11015     /* Nutation matrix. */
11016        rmatn = jauNumat(eps, nut.dpsi, nut.deps);
11017 
11018        return rmatn;
11019 
11020         }
11021     
11022 
11023     /**
11024     *  Form the matrix of nutation.
11025     *
11026     *<p>This function is derived from the International Astronomical Union's
11027     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11028     *
11029     *<p>Status:  support function.
11030     *
11031     *<!-- Given: -->
11032     *     @param epsa         double          mean obliquity of date (Note 1)
11033     *     @param dpsi double          nutation (Note 2)
11034     *     @param deps double          nutation (Note 2) 
11035     *
11036     *<!-- Returned: -->
11037     *     @return rmatn        double[3][3]     <u>returned</u> nutation matrix (Note 3)
11038     *
11039     * <p>Notes:
11040     * <ol>
11041     *
11042     *
11043     * <li> The supplied mean obliquity epsa, must be consistent with the
11044     *     precession-nutation models from which dpsi and deps were obtained.
11045     *
11046     * <li> The caller is responsible for providing the nutation components;
11047     *     they are in longitude and obliquity, in radians and are with
11048     *     respect to the equinox and ecliptic of date.
11049     *
11050     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
11051     *     where the p-vector V(true) is with respect to the true
11052     *     equatorial triad of date and the p-vector V(mean) is with
11053     *     respect to the mean equatorial triad of date.
11054     *</ol>
11055     *<p>Called:<ul>
11056     *     <li>{@link #jauIr} initialize r-matrix to identity
11057     *     <li>{@link #jauRx} rotate around X-axis
11058     *     <li>{@link #jauRz} rotate around Z-axis
11059     * </ul>
11060     *<p>Reference:
11061     *
11062     *     <p>Explanatory Supplement to the Astronomical Almanac,
11063     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11064     *     Section 3.222-3 (p114).
11065     *
11066     *@version 2008 May 11
11067     *
11068     *  @since Release 20101201
11069     *
11070     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11071     */
11072     public static double[][] jauNumat(double epsa, double dpsi, double deps)
11073     {
11074         double rmatn[][] = new double[3][3];
11075     /* Build the rotation matrix. */
11076        jauIr(rmatn);
11077        jauRx(epsa, rmatn);
11078        jauRz(-dpsi, rmatn);
11079        jauRx(-(epsa + deps), rmatn);
11080 
11081        return rmatn;
11082 
11083         }
11084     /**
11085      * Nutation Terms.
11086      *  .
11087      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
11088      * @version $Revision$ $date$
11089      */
11090     public static class NutationTerms {
11091         /**  nutation component in longitude  */
11092         public double dpsi;
11093         /**  nutation component in obliquity */
11094         public double deps;
11095         public NutationTerms(double dpsi, double deps) {
11096             this.dpsi = dpsi;
11097             this.deps = deps;
11098         }
11099     }
11100     /**
11101     *  Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation
11102     *  with free core nutation omitted).
11103     *
11104     *<p>This function is derived from the International Astronomical Union's
11105     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11106     *
11107     *<p>Status:  canonical model.
11108     *
11109     *<!-- Given: -->
11110     *     @param date1 double TT as a 2-part Julian Date (Note 1)
11111     *     @param date2 double TT as a 2-part Julian Date (Note 1)
11112     *
11113     *<!-- Returned: -->
11114     *     @return    <u>returned</u> nutation, luni-solar + planetary (Note 2)
11115     *
11116     * <p>Notes:
11117     * <ol>
11118     *
11119     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
11120     *     convenient way between the two arguments.  For example,
11121     *     JD(TT)=2450123.7 could be expressed in any of these ways,
11122     *     among others:
11123     *<pre>
11124     *            date1          date2
11125     *
11126     *         2450123.7           0.0       (JD method)
11127     *         2451545.0       -1421.3       (J2000 method)
11128     *         2400000.5       50123.2       (MJD method)
11129     *         2450123.5           0.2       (date &amp; time method)
11130     *</pre>
11131     *     The JD method is the most natural and convenient to use in
11132     *     cases where the loss of several decimal digits of resolution
11133     *     is acceptable.  The J2000 method is best matched to the way
11134     *     the argument is handled internally and will deliver the
11135     *     optimum resolution.  The MJD method and the date &amp; time methods
11136     *     are both good compromises between resolution and convenience.
11137     *
11138     * <li> The nutation components in longitude and obliquity are in radians
11139     *     and with respect to the equinox and ecliptic of date.  The
11140     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
11141     *     value of 84381.448 arcsec.
11142     *
11143     *     Both the luni-solar and planetary nutations are included.  The
11144     *     latter are due to direct planetary nutations and the
11145     *     perturbations of the lunar and terrestrial orbits.
11146     *
11147     * <li> The function computes the MHB2000 nutation series with the
11148     *     associated corrections for planetary nutations.  It is an
11149     *     implementation of the nutation part of the IAU 2000A precession-
11150     *     nutation model, formally adopted by the IAU General Assembly in
11151     *     2000, namely MHB2000 (Mathews et al. 2002), but with the free
11152     *     core nutation (FCN - see Note 4) omitted.
11153     *
11154     * <li> The full MHB2000 model also contains contributions to the
11155     *     nutations in longitude and obliquity due to the free-excitation
11156     *     of the free-core-nutation during the period 1979-2000.  These FCN
11157     *     terms, which are time-dependent and unpredictable, are NOT
11158     *     included in the present function and, if required, must be
11159     *     independently computed.  With the FCN corrections included, the
11160     *     present function delivers a pole which is at current epochs
11161     *     accurate to a few hundred microarcseconds.  The omission of FCN
11162     *     introduces further errors of about that size.
11163     *
11164     * <li> The present function provides classical nutation.  The MHB2000
11165     *     algorithm, from which it is adapted, deals also with (i) the
11166     *     offsets between the GCRS and mean poles and (ii) the adjustments
11167     *     in longitude and obliquity due to the changed precession rates.
11168     *     These additional functions, namely frame bias and precession
11169     *     adjustments, are supported by the JSOFA functions jauBi00  and
11170     *     jauPr00.
11171     *
11172     * <li> The MHB2000 algorithm also provides "total" nutations, comprising
11173     *     the arithmetic sum of the frame bias, precession adjustments,
11174     *     luni-solar nutation and planetary nutation.  These total
11175     *     nutations can be used in combination with an existing IAU 1976
11176     *     precession implementation, such as jauPmat76,  to deliver GCRS-
11177     *     to-true predictions of sub-mas accuracy at current dates.
11178     *     However, there are three shortcomings in the MHB2000 model that
11179     *     must be taken into account if more accurate or definitive results
11180     *     are required (see Wallace 2002):
11181     *
11182     *       (i) The MHB2000 total nutations are simply arithmetic sums,
11183     *           yet in reality the various components are successive Euler
11184     *           rotations.  This slight lack of rigor leads to cross terms
11185     *           that exceed 1 mas after a century.  The rigorous procedure
11186     *           is to form the GCRS-to-true rotation matrix by applying the
11187     *           bias, precession and nutation in that order.
11188     *
11189     *      (ii) Although the precession adjustments are stated to be with
11190     *           respect to Lieske et al. (1977), the MHB2000 model does
11191     *           not specify which set of Euler angles are to be used and
11192     *           how the adjustments are to be applied.  The most literal
11193     *           and straightforward procedure is to adopt the 4-rotation
11194     *           epsilon_0, psi_A, omega_A, xi_A option, and to add DPSIPR
11195     *           to psi_A and DEPSPR to both omega_A and eps_A.
11196     *
11197     *     (iii) The MHB2000 model predates the determination by Chapront
11198     *           et al. (2002) of a 14.6 mas displacement between the
11199     *           J2000.0 mean equinox and the origin of the ICRS frame.  It
11200     *           should, however, be noted that neglecting this displacement
11201     *           when calculating star coordinates does not lead to a
11202     *           14.6 mas change in right ascension, only a small second-
11203     *           order distortion in the pattern of the precession-nutation
11204     *           effect.
11205     *
11206     *     For these reasons, the JSOFA functions do not generate the "total
11207     *     nutations" directly, though they can of course easily be
11208     *     generated by calling jauBi00, jauPr00 and the present function
11209     *     and adding the results.
11210     *
11211     * <li> The MHB2000 model contains 41 instances where the same frequency
11212     *     appears multiple times, of which 38 are duplicates and three are
11213     *     triplicates.  To keep the present code close to the original MHB
11214     *     algorithm, this small inefficiency has not been corrected.
11215     *</ol>
11216     *<p>Called:<ul>
11217     *     <li>{@link #jauFal03} mean anomaly of the Moon
11218     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
11219     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
11220     *     <li>{@link #jauFame03} mean longitude of Mercury
11221     *     <li>{@link #jauFave03} mean longitude of Venus
11222     *     <li>{@link #jauFae03} mean longitude of Earth
11223     *     <li>{@link #jauFama03} mean longitude of Mars
11224     *     <li>{@link #jauFaju03} mean longitude of Jupiter
11225     *     <li>{@link #jauFasa03} mean longitude of Saturn
11226     *     <li>{@link #jauFaur03} mean longitude of Uranus
11227     *     <li>{@link #jauFapa03} general accumulated precession in longitude
11228     * </ul>
11229     *<p>References:
11230     *
11231     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
11232     *     Astron.Astrophys. 387, 700
11233     *
11234     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
11235     *     Astron.Astrophys. 58, 1-16
11236     *
11237     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
11238     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
11239     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
11240     *
11241     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
11242     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
11243     *
11244     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
11245     *     Astron.Astrophys.Supp.Ser. 135, 111
11246     *
11247     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
11248     *     Resolutions", in IERS Workshop 5.1 (2002)
11249     *
11250     *@version 2009 December 17
11251     *
11252     *  @since Release 20101201
11253     *
11254     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11255     */
11256     public static NutationTerms jauNut00a(double date1, double date2 )
11257     {
11258        int i;
11259        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
11260               al, af, ad, aom, alme, alve, alea, alma,
11261               alju, alsa, alur, alne, apa, dpsils, depsls,
11262               dpsipl, depspl;
11263 
11264     /* Units of 0.1 microarcsecond to radians */
11265        final double U2R = DAS2R / 1e7;
11266 
11267     /* ------------------------- */
11268     /* Luni-Solar nutation model */
11269     /* ------------------------- */
11270 
11271     /* The units for the sine and cosine coefficients are */
11272     /* 0.1 microarcsecond and the same per Julian century */
11273 
11274        final class NutationModel {
11275           int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
11276           double sp,spt,cp;     /* longitude sin, t*sin, cos coefficients */
11277           double ce,cet,se;     /* obliquity cos, t*cos, sin coefficients */
11278           public NutationModel(int nl,int nlp,int nf,int nd, int nom,
11279           double sp,double spt,double cp,     
11280           double ce,double cet,double se ) {
11281            this.nl = nl;
11282            this.nlp = nlp;
11283            this.nf = nf;
11284            this.nd = nd;
11285            this.nom = nom;
11286            this.sp = sp;
11287            this.spt = spt;
11288            this.cp = cp;
11289            this.ce = ce;
11290            this.cet = cet;
11291            this.se = se;
11292         }
11293        }
11294        
11295        NutationModel xls[] = {
11296 
11297        /* 1- 10 */
11298           new NutationModel( 0, 0, 0, 0, 1,
11299              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
11300           new NutationModel( 0, 0, 2,-2, 2,
11301                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
11302           new NutationModel( 0, 0, 2, 0, 2,-2276413.0,-234.0,2796.0,978459.0,-485.0, 1374.0),
11303           new NutationModel( 0, 0, 0, 0, 2,2074554.0, 207.0, -698.0,-897492.0,470.0, -291.0),
11304           new NutationModel( 0, 1, 0, 0, 0,1475877.0,-3633.0,11817.0,73871.0,-184.0,-1924.0),
11305           new NutationModel( 0, 1, 2,-2, 2,-516821.0,1226.0, -524.0,224386.0,-677.0, -174.0),
11306           new NutationModel( 1, 0, 0, 0, 0, 711159.0,  73.0, -872.0,  -6750.0,  0.0,  358.0),
11307           new NutationModel( 0, 0, 2, 0, 1,-387298.0,-367.0,  380.0, 200728.0, 18.0,  318.0),
11308           new NutationModel( 1, 0, 2, 0, 2,-301461.0, -36.0,  816.0, 129025.0,-63.0,  367.0),
11309           new NutationModel( 0,-1, 2,-2, 2, 215829.0,-494.0,  111.0, -95929.0,299.0,  132.0),
11310 
11311        /* 11-20 */
11312           new NutationModel( 0, 0, 2,-2, 1, 128227.0, 137.0,  181.0, -68982.0, -9.0,   39.0),
11313           new NutationModel(-1, 0, 2, 0, 2, 123457.0,  11.0,   19.0, -53311.0, 32.0,   -4.0),
11314           new NutationModel(-1, 0, 0, 2, 0, 156994.0,  10.0, -168.0,  -1235.0,  0.0,   82.0),
11315           new NutationModel( 1, 0, 0, 0, 1,  63110.0,  63.0,   27.0, -33228.0,  0.0,   -9.0),
11316           new NutationModel(-1, 0, 0, 0, 1, -57976.0, -63.0, -189.0,  31429.0,  0.0,  -75.0),
11317           new NutationModel(-1, 0, 2, 2, 2, -59641.0, -11.0,  149.0,  25543.0,-11.0,   66.0),
11318           new NutationModel( 1, 0, 2, 0, 1, -51613.0, -42.0,  129.0,  26366.0,  0.0,   78.0),
11319           new NutationModel(-2, 0, 2, 0, 1,  45893.0,  50.0,   31.0, -24236.0,-10.0,   20.0),
11320           new NutationModel( 0, 0, 0, 2, 0,  63384.0,  11.0, -150.0,  -1220.0,  0.0,   29.0),
11321           new NutationModel( 0, 0, 2, 2, 2, -38571.0,  -1.0,  158.0,  16452.0,-11.0,   68.0),
11322 
11323        /* 21-30 */
11324           new NutationModel( 0,-2, 2,-2, 2,  32481.0,   0.0,    0.0, -13870.0,  0.0,    0.0),
11325           new NutationModel(-2, 0, 0, 2, 0, -47722.0,   0.0,  -18.0,    477.0,  0.0,  -25.0),
11326           new NutationModel( 2, 0, 2, 0, 2, -31046.0,  -1.0,  131.0,  13238.0,-11.0,   59.0),
11327           new NutationModel( 1, 0, 2,-2, 2,  28593.0,   0.0,   -1.0, -12338.0, 10.0,   -3.0),
11328           new NutationModel(-1, 0, 2, 0, 1,  20441.0,  21.0,   10.0, -10758.0,  0.0,   -3.0),
11329           new NutationModel( 2, 0, 0, 0, 0,  29243.0,   0.0,  -74.0,   -609.0,  0.0,   13.0),
11330           new NutationModel( 0, 0, 2, 0, 0,  25887.0,   0.0,  -66.0,   -550.0,  0.0,   11.0),
11331           new NutationModel( 0, 1, 0, 0, 1, -14053.0, -25.0,   79.0,   8551.0, -2.0,  -45.0),
11332           new NutationModel(-1, 0, 0, 2, 1,  15164.0,  10.0,   11.0,  -8001.0,  0.0,   -1.0),
11333           new NutationModel( 0, 2, 2,-2, 2, -15794.0,  72.0,  -16.0,   6850.0,-42.0,   -5.0),
11334 
11335        /* 31-40 */
11336           new NutationModel( 0, 0,-2, 2, 0,  21783.0,   0.0,   13.0,   -167.0,  0.0,   13.0),
11337           new NutationModel( 1, 0, 0,-2, 1, -12873.0, -10.0,  -37.0,   6953.0,  0.0,  -14.0),
11338           new NutationModel( 0,-1, 0, 0, 1, -12654.0,  11.0,   63.0,   6415.0,  0.0,   26.0),
11339           new NutationModel(-1, 0, 2, 2, 1, -10204.0,   0.0,   25.0,   5222.0,  0.0,   15.0),
11340           new NutationModel( 0, 2, 0, 0, 0,  16707.0, -85.0,  -10.0,    168.0, -1.0,   10.0),
11341           new NutationModel( 1, 0, 2, 2, 2,  -7691.0,   0.0,   44.0,   3268.0,  0.0,   19.0),
11342           new NutationModel(-2, 0, 2, 0, 0, -11024.0,   0.0,  -14.0,    104.0,  0.0,    2.0),
11343           new NutationModel( 0, 1, 2, 0, 2,   7566.0, -21.0,  -11.0,  -3250.0,  0.0,   -5.0),
11344           new NutationModel( 0, 0, 2, 2, 1,  -6637.0, -11.0,   25.0,   3353.0,  0.0,   14.0),
11345           new NutationModel( 0,-1, 2, 0, 2,  -7141.0,  21.0,    8.0,   3070.0,  0.0,    4.0),
11346 
11347        /* 41-50 */
11348           new NutationModel( 0, 0, 0, 2, 1,  -6302.0, -11.0,    2.0,   3272.0,  0.0,    4.0),
11349           new NutationModel( 1, 0, 2,-2, 1,   5800.0,  10.0,    2.0,  -3045.0,  0.0,   -1.0),
11350           new NutationModel( 2, 0, 2,-2, 2,   6443.0,   0.0,   -7.0,  -2768.0,  0.0,   -4.0),
11351           new NutationModel(-2, 0, 0, 2, 1,  -5774.0, -11.0,  -15.0,   3041.0,  0.0,   -5.0),
11352           new NutationModel( 2, 0, 2, 0, 1,  -5350.0,   0.0,   21.0,   2695.0,  0.0,   12.0),
11353           new NutationModel( 0,-1, 2,-2, 1,  -4752.0, -11.0,   -3.0,   2719.0,  0.0,   -3.0),
11354           new NutationModel( 0, 0, 0,-2, 1,  -4940.0, -11.0,  -21.0,   2720.0,  0.0,   -9.0),
11355           new NutationModel(-1,-1, 0, 2, 0,   7350.0,   0.0,   -8.0,    -51.0,  0.0,    4.0),
11356           new NutationModel( 2, 0, 0,-2, 1,   4065.0,   0.0,    6.0,  -2206.0,  0.0,    1.0),
11357           new NutationModel( 1, 0, 0, 2, 0,   6579.0,   0.0,  -24.0,   -199.0,  0.0,    2.0),
11358 
11359        /* 51-60 */
11360           new NutationModel( 0, 1, 2,-2, 1,   3579.0,   0.0,    5.0,  -1900.0,  0.0,    1.0),
11361           new NutationModel( 1,-1, 0, 0, 0,   4725.0,   0.0,   -6.0,    -41.0,  0.0,    3.0),
11362           new NutationModel(-2, 0, 2, 0, 2,  -3075.0,   0.0,   -2.0,   1313.0,  0.0,   -1.0),
11363           new NutationModel( 3, 0, 2, 0, 2,  -2904.0,   0.0,   15.0,   1233.0,  0.0,    7.0),
11364           new NutationModel( 0,-1, 0, 2, 0,   4348.0,   0.0,  -10.0,    -81.0,  0.0,    2.0),
11365           new NutationModel( 1,-1, 2, 0, 2,  -2878.0,   0.0,    8.0,   1232.0,  0.0,    4.0),
11366           new NutationModel( 0, 0, 0, 1, 0,  -4230.0,   0.0,    5.0,    -20.0,  0.0,   -2.0),
11367           new NutationModel(-1,-1, 2, 2, 2,  -2819.0,   0.0,    7.0,   1207.0,  0.0,    3.0),
11368           new NutationModel(-1, 0, 2, 0, 0,  -4056.0,   0.0,    5.0,     40.0,  0.0,   -2.0),
11369           new NutationModel( 0,-1, 2, 2, 2,  -2647.0,   0.0,   11.0,   1129.0,  0.0,    5.0),
11370 
11371        /* 61-70 */
11372           new NutationModel(-2, 0, 0, 0, 1,  -2294.0,   0.0,  -10.0,   1266.0,  0.0,   -4.0),
11373           new NutationModel( 1, 1, 2, 0, 2,   2481.0,   0.0,   -7.0,  -1062.0,  0.0,   -3.0),
11374           new NutationModel( 2, 0, 0, 0, 1,   2179.0,   0.0,   -2.0,  -1129.0,  0.0,   -2.0),
11375           new NutationModel(-1, 1, 0, 1, 0,   3276.0,   0.0,    1.0,     -9.0,  0.0,    0.0),
11376           new NutationModel( 1, 1, 0, 0, 0,  -3389.0,   0.0,    5.0,     35.0,  0.0,   -2.0),
11377           new NutationModel( 1, 0, 2, 0, 0,   3339.0,   0.0,  -13.0,   -107.0,  0.0,    1.0),
11378           new NutationModel(-1, 0, 2,-2, 1,  -1987.0,   0.0,   -6.0,   1073.0,  0.0,   -2.0),
11379           new NutationModel( 1, 0, 0, 0, 2,  -1981.0,   0.0,    0.0,    854.0,  0.0,    0.0),
11380           new NutationModel(-1, 0, 0, 1, 0,   4026.0,   0.0, -353.0,   -553.0,  0.0, -139.0),
11381           new NutationModel( 0, 0, 2, 1, 2,   1660.0,   0.0,   -5.0,   -710.0,  0.0,   -2.0),
11382 
11383        /* 71-80 */
11384           new NutationModel(-1, 0, 2, 4, 2,  -1521.0,   0.0,    9.0,    647.0,  0.0,    4.0),
11385           new NutationModel(-1, 1, 0, 1, 1,   1314.0,   0.0,    0.0,   -700.0,  0.0,    0.0),
11386           new NutationModel( 0,-2, 2,-2, 1,  -1283.0,   0.0,    0.0,    672.0,  0.0,    0.0),
11387           new NutationModel( 1, 0, 2, 2, 1,  -1331.0,   0.0,    8.0,    663.0,  0.0,    4.0),
11388           new NutationModel(-2, 0, 2, 2, 2,   1383.0,   0.0,   -2.0,   -594.0,  0.0,   -2.0),
11389           new NutationModel(-1, 0, 0, 0, 2,   1405.0,   0.0,    4.0,   -610.0,  0.0,    2.0),
11390           new NutationModel( 1, 1, 2,-2, 2,   1290.0,   0.0,    0.0,   -556.0,  0.0,    0.0),
11391           new NutationModel(-2, 0, 2, 4, 2,  -1214.0,   0.0,    5.0,    518.0,  0.0,    2.0),
11392           new NutationModel(-1, 0, 4, 0, 2,   1146.0,   0.0,   -3.0,   -490.0,  0.0,   -1.0),
11393           new NutationModel( 2, 0, 2,-2, 1,   1019.0,   0.0,   -1.0,   -527.0,  0.0,   -1.0),
11394 
11395        /* 81-90 */
11396           new NutationModel( 2, 0, 2, 2, 2,  -1100.0,   0.0,    9.0,    465.0,  0.0,    4.0),
11397           new NutationModel( 1, 0, 0, 2, 1,   -970.0,   0.0,    2.0,    496.0,  0.0,    1.0),
11398           new NutationModel( 3, 0, 0, 0, 0,   1575.0,   0.0,   -6.0,    -50.0,  0.0,    0.0),
11399           new NutationModel( 3, 0, 2,-2, 2,    934.0,   0.0,   -3.0,   -399.0,  0.0,   -1.0),
11400           new NutationModel( 0, 0, 4,-2, 2,    922.0,   0.0,   -1.0,   -395.0,  0.0,   -1.0),
11401           new NutationModel( 0, 1, 2, 0, 1,    815.0,   0.0,   -1.0,   -422.0,  0.0,   -1.0),
11402           new NutationModel( 0, 0,-2, 2, 1,    834.0,   0.0,    2.0,   -440.0,  0.0,    1.0),
11403           new NutationModel( 0, 0, 2,-2, 3,   1248.0,   0.0,    0.0,   -170.0,  0.0,    1.0),
11404           new NutationModel(-1, 0, 0, 4, 0,   1338.0,   0.0,   -5.0,    -39.0,  0.0,    0.0),
11405           new NutationModel( 2, 0,-2, 0, 1,    716.0,   0.0,   -2.0,   -389.0,  0.0,   -1.0),
11406 
11407        /* 91-100 */
11408           new NutationModel(-2, 0, 0, 4, 0,   1282.0,   0.0,   -3.0,    -23.0,  0.0,    1.0),
11409           new NutationModel(-1,-1, 0, 2, 1,    742.0,   0.0,    1.0,   -391.0,  0.0,    0.0),
11410           new NutationModel(-1, 0, 0, 1, 1,   1020.0,   0.0,  -25.0,   -495.0,  0.0,  -10.0),
11411           new NutationModel( 0, 1, 0, 0, 2,    715.0,   0.0,   -4.0,   -326.0,  0.0,    2.0),
11412           new NutationModel( 0, 0,-2, 0, 1,   -666.0,   0.0,   -3.0,    369.0,  0.0,   -1.0),
11413           new NutationModel( 0,-1, 2, 0, 1,   -667.0,   0.0,    1.0,    346.0,  0.0,    1.0),
11414           new NutationModel( 0, 0, 2,-1, 2,   -704.0,   0.0,    0.0,    304.0,  0.0,    0.0),
11415           new NutationModel( 0, 0, 2, 4, 2,   -694.0,   0.0,    5.0,    294.0,  0.0,    2.0),
11416           new NutationModel(-2,-1, 0, 2, 0,  -1014.0,   0.0,   -1.0,      4.0,  0.0,   -1.0),
11417           new NutationModel( 1, 1, 0,-2, 1,   -585.0,   0.0,   -2.0,    316.0,  0.0,   -1.0),
11418 
11419        /* 101-110 */
11420           new NutationModel(-1, 1, 0, 2, 0,   -949.0,   0.0,    1.0,      8.0,  0.0,   -1.0),
11421           new NutationModel(-1, 1, 0, 1, 2,   -595.0,   0.0,    0.0,    258.0,  0.0,    0.0),
11422           new NutationModel( 1,-1, 0, 0, 1,    528.0,   0.0,    0.0,   -279.0,  0.0,    0.0),
11423           new NutationModel( 1,-1, 2, 2, 2,   -590.0,   0.0,    4.0,    252.0,  0.0,    2.0),
11424           new NutationModel(-1, 1, 2, 2, 2,    570.0,   0.0,   -2.0,   -244.0,  0.0,   -1.0),
11425           new NutationModel( 3, 0, 2, 0, 1,   -502.0,   0.0,    3.0,    250.0,  0.0,    2.0),
11426           new NutationModel( 0, 1,-2, 2, 0,   -875.0,   0.0,    1.0,     29.0,  0.0,    0.0),
11427           new NutationModel(-1, 0, 0,-2, 1,   -492.0,   0.0,   -3.0,    275.0,  0.0,   -1.0),
11428           new NutationModel( 0, 1, 2, 2, 2,    535.0,   0.0,   -2.0,   -228.0,  0.0,   -1.0),
11429           new NutationModel(-1,-1, 2, 2, 1,   -467.0,   0.0,    1.0,    240.0,  0.0,    1.0),
11430 
11431        /* 111-120 */
11432           new NutationModel( 0,-1, 0, 0, 2,    591.0,   0.0,    0.0,   -253.0,  0.0,    0.0),
11433           new NutationModel( 1, 0, 2,-4, 1,   -453.0,   0.0,   -1.0,    244.0,  0.0,   -1.0),
11434           new NutationModel(-1, 0,-2, 2, 0,    766.0,   0.0,    1.0,      9.0,  0.0,    0.0),
11435           new NutationModel( 0,-1, 2, 2, 1,   -446.0,   0.0,    2.0,    225.0,  0.0,    1.0),
11436           new NutationModel( 2,-1, 2, 0, 2,   -488.0,   0.0,    2.0,    207.0,  0.0,    1.0),
11437           new NutationModel( 0, 0, 0, 2, 2,   -468.0,   0.0,    0.0,    201.0,  0.0,    0.0),
11438           new NutationModel( 1,-1, 2, 0, 1,   -421.0,   0.0,    1.0,    216.0,  0.0,    1.0),
11439           new NutationModel(-1, 1, 2, 0, 2,    463.0,   0.0,    0.0,   -200.0,  0.0,    0.0),
11440           new NutationModel( 0, 1, 0, 2, 0,   -673.0,   0.0,    2.0,     14.0,  0.0,    0.0),
11441           new NutationModel( 0,-1,-2, 2, 0,    658.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11442 
11443        /* 121-130 */
11444           new NutationModel( 0, 3, 2,-2, 2,   -438.0,   0.0,    0.0,    188.0,  0.0,    0.0),
11445           new NutationModel( 0, 0, 0, 1, 1,   -390.0,   0.0,    0.0,    205.0,  0.0,    0.0),
11446           new NutationModel(-1, 0, 2, 2, 0,    639.0, -11.0,   -2.0,    -19.0,  0.0,    0.0),
11447           new NutationModel( 2, 1, 2, 0, 2,    412.0,   0.0,   -2.0,   -176.0,  0.0,   -1.0),
11448           new NutationModel( 1, 1, 0, 0, 1,   -361.0,   0.0,    0.0,    189.0,  0.0,    0.0),
11449           new NutationModel( 1, 1, 2, 0, 1,    360.0,   0.0,   -1.0,   -185.0,  0.0,   -1.0),
11450           new NutationModel( 2, 0, 0, 2, 0,    588.0,   0.0,   -3.0,    -24.0,  0.0,    0.0),
11451           new NutationModel( 1, 0,-2, 2, 0,   -578.0,   0.0,    1.0,      5.0,  0.0,    0.0),
11452           new NutationModel(-1, 0, 0, 2, 2,   -396.0,   0.0,    0.0,    171.0,  0.0,    0.0),
11453           new NutationModel( 0, 1, 0, 1, 0,    565.0,   0.0,   -1.0,     -6.0,  0.0,    0.0),
11454 
11455        /* 131-140 */
11456           new NutationModel( 0, 1, 0,-2, 1,   -335.0,   0.0,   -1.0,    184.0,  0.0,   -1.0),
11457           new NutationModel(-1, 0, 2,-2, 2,    357.0,   0.0,    1.0,   -154.0,  0.0,    0.0),
11458           new NutationModel( 0, 0, 0,-1, 1,    321.0,   0.0,    1.0,   -174.0,  0.0,    0.0),
11459           new NutationModel(-1, 1, 0, 0, 1,   -301.0,   0.0,   -1.0,    162.0,  0.0,    0.0),
11460           new NutationModel( 1, 0, 2,-1, 2,   -334.0,   0.0,    0.0,    144.0,  0.0,    0.0),
11461           new NutationModel( 1,-1, 0, 2, 0,    493.0,   0.0,   -2.0,    -15.0,  0.0,    0.0),
11462           new NutationModel( 0, 0, 0, 4, 0,    494.0,   0.0,   -2.0,    -19.0,  0.0,    0.0),
11463           new NutationModel( 1, 0, 2, 1, 2,    337.0,   0.0,   -1.0,   -143.0,  0.0,   -1.0),
11464           new NutationModel( 0, 0, 2, 1, 1,    280.0,   0.0,   -1.0,   -144.0,  0.0,    0.0),
11465           new NutationModel( 1, 0, 0,-2, 2,    309.0,   0.0,    1.0,   -134.0,  0.0,    0.0),
11466 
11467        /* 141-150 */
11468           new NutationModel(-1, 0, 2, 4, 1,   -263.0,   0.0,    2.0,    131.0,  0.0,    1.0),
11469           new NutationModel( 1, 0,-2, 0, 1,    253.0,   0.0,    1.0,   -138.0,  0.0,    0.0),
11470           new NutationModel( 1, 1, 2,-2, 1,    245.0,   0.0,    0.0,   -128.0,  0.0,    0.0),
11471           new NutationModel( 0, 0, 2, 2, 0,    416.0,   0.0,   -2.0,    -17.0,  0.0,    0.0),
11472           new NutationModel(-1, 0, 2,-1, 1,   -229.0,   0.0,    0.0,    128.0,  0.0,    0.0),
11473           new NutationModel(-2, 0, 2, 2, 1,    231.0,   0.0,    0.0,   -120.0,  0.0,    0.0),
11474           new NutationModel( 4, 0, 2, 0, 2,   -259.0,   0.0,    2.0,    109.0,  0.0,    1.0),
11475           new NutationModel( 2,-1, 0, 0, 0,    375.0,   0.0,   -1.0,     -8.0,  0.0,    0.0),
11476           new NutationModel( 2, 1, 2,-2, 2,    252.0,   0.0,    0.0,   -108.0,  0.0,    0.0),
11477           new NutationModel( 0, 1, 2, 1, 2,   -245.0,   0.0,    1.0,    104.0,  0.0,    0.0),
11478 
11479        /* 151-160 */
11480           new NutationModel( 1, 0, 4,-2, 2,    243.0,   0.0,   -1.0,   -104.0,  0.0,    0.0),
11481           new NutationModel(-1,-1, 0, 0, 1,    208.0,   0.0,    1.0,   -112.0,  0.0,    0.0),
11482           new NutationModel( 0, 1, 0, 2, 1,    199.0,   0.0,    0.0,   -102.0,  0.0,    0.0),
11483           new NutationModel(-2, 0, 2, 4, 1,   -208.0,   0.0,    1.0,    105.0,  0.0,    0.0),
11484           new NutationModel( 2, 0, 2, 0, 0,    335.0,   0.0,   -2.0,    -14.0,  0.0,    0.0),
11485           new NutationModel( 1, 0, 0, 1, 0,   -325.0,   0.0,    1.0,      7.0,  0.0,    0.0),
11486           new NutationModel(-1, 0, 0, 4, 1,   -187.0,   0.0,    0.0,     96.0,  0.0,    0.0),
11487           new NutationModel(-1, 0, 4, 0, 1,    197.0,   0.0,   -1.0,   -100.0,  0.0,    0.0),
11488           new NutationModel( 2, 0, 2, 2, 1,   -192.0,   0.0,    2.0,     94.0,  0.0,    1.0),
11489           new NutationModel( 0, 0, 2,-3, 2,   -188.0,   0.0,    0.0,     83.0,  0.0,    0.0),
11490 
11491        /* 161-170 */
11492           new NutationModel(-1,-2, 0, 2, 0,    276.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11493           new NutationModel( 2, 1, 0, 0, 0,   -286.0,   0.0,    1.0,      6.0,  0.0,    0.0),
11494           new NutationModel( 0, 0, 4, 0, 2,    186.0,   0.0,   -1.0,    -79.0,  0.0,    0.0),
11495           new NutationModel( 0, 0, 0, 0, 3,   -219.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11496           new NutationModel( 0, 3, 0, 0, 0,    276.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11497           new NutationModel( 0, 0, 2,-4, 1,   -153.0,   0.0,   -1.0,     84.0,  0.0,    0.0),
11498           new NutationModel( 0,-1, 0, 2, 1,   -156.0,   0.0,    0.0,     81.0,  0.0,    0.0),
11499           new NutationModel( 0, 0, 0, 4, 1,   -154.0,   0.0,    1.0,     78.0,  0.0,    0.0),
11500           new NutationModel(-1,-1, 2, 4, 2,   -174.0,   0.0,    1.0,     75.0,  0.0,    0.0),
11501           new NutationModel( 1, 0, 2, 4, 2,   -163.0,   0.0,    2.0,     69.0,  0.0,    1.0),
11502 
11503        /* 171-180 */
11504           new NutationModel(-2, 2, 0, 2, 0,   -228.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11505           new NutationModel(-2,-1, 2, 0, 1,     91.0,   0.0,   -4.0,    -54.0,  0.0,   -2.0),
11506           new NutationModel(-2, 0, 0, 2, 2,    175.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11507           new NutationModel(-1,-1, 2, 0, 2,   -159.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11508           new NutationModel( 0, 0, 4,-2, 1,    141.0,   0.0,    0.0,    -72.0,  0.0,    0.0),
11509           new NutationModel( 3, 0, 2,-2, 1,    147.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11510           new NutationModel(-2,-1, 0, 2, 1,   -132.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11511           new NutationModel( 1, 0, 0,-1, 1,    159.0,   0.0,  -28.0,    -54.0,  0.0,   11.0),
11512           new NutationModel( 0,-2, 0, 2, 0,    213.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11513           new NutationModel(-2, 0, 0, 4, 1,    123.0,   0.0,    0.0,    -64.0,  0.0,    0.0),
11514 
11515        /* 181-190 */
11516           new NutationModel(-3, 0, 0, 0, 1,   -118.0,   0.0,   -1.0,     66.0,  0.0,    0.0),
11517           new NutationModel( 1, 1, 2, 2, 2,    144.0,   0.0,   -1.0,    -61.0,  0.0,    0.0),
11518           new NutationModel( 0, 0, 2, 4, 1,   -121.0,   0.0,    1.0,     60.0,  0.0,    0.0),
11519           new NutationModel( 3, 0, 2, 2, 2,   -134.0,   0.0,    1.0,     56.0,  0.0,    1.0),
11520           new NutationModel(-1, 1, 2,-2, 1,   -105.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11521           new NutationModel( 2, 0, 0,-4, 1,   -102.0,   0.0,    0.0,     56.0,  0.0,    0.0),
11522           new NutationModel( 0, 0, 0,-2, 2,    120.0,   0.0,    0.0,    -52.0,  0.0,    0.0),
11523           new NutationModel( 2, 0, 2,-4, 1,    101.0,   0.0,    0.0,    -54.0,  0.0,    0.0),
11524           new NutationModel(-1, 1, 0, 2, 1,   -113.0,   0.0,    0.0,     59.0,  0.0,    0.0),
11525           new NutationModel( 0, 0, 2,-1, 1,   -106.0,   0.0,    0.0,     61.0,  0.0,    0.0),
11526 
11527        /* 191-200 */
11528           new NutationModel( 0,-2, 2, 2, 2,   -129.0,   0.0,    1.0,     55.0,  0.0,    0.0),
11529           new NutationModel( 2, 0, 0, 2, 1,   -114.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11530           new NutationModel( 4, 0, 2,-2, 2,    113.0,   0.0,   -1.0,    -49.0,  0.0,    0.0),
11531           new NutationModel( 2, 0, 0,-2, 2,   -102.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11532           new NutationModel( 0, 2, 0, 0, 1,    -94.0,   0.0,    0.0,     51.0,  0.0,    0.0),
11533           new NutationModel( 1, 0, 0,-4, 1,   -100.0,   0.0,   -1.0,     56.0,  0.0,    0.0),
11534           new NutationModel( 0, 2, 2,-2, 1,     87.0,   0.0,    0.0,    -47.0,  0.0,    0.0),
11535           new NutationModel(-3, 0, 0, 4, 0,    161.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11536           new NutationModel(-1, 1, 2, 0, 1,     96.0,   0.0,    0.0,    -50.0,  0.0,    0.0),
11537           new NutationModel(-1,-1, 0, 4, 0,    151.0,   0.0,   -1.0,     -5.0,  0.0,    0.0),
11538 
11539        /* 201-210 */
11540           new NutationModel(-1,-2, 2, 2, 2,   -104.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11541           new NutationModel(-2,-1, 2, 4, 2,   -110.0,   0.0,    0.0,     48.0,  0.0,    0.0),
11542           new NutationModel( 1,-1, 2, 2, 1,   -100.0,   0.0,    1.0,     50.0,  0.0,    0.0),
11543           new NutationModel(-2, 1, 0, 2, 0,     92.0,   0.0,   -5.0,     12.0,  0.0,   -2.0),
11544           new NutationModel(-2, 1, 2, 0, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11545           new NutationModel( 2, 1, 0,-2, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11546           new NutationModel(-3, 0, 2, 0, 1,    -78.0,   0.0,    0.0,     41.0,  0.0,    0.0),
11547           new NutationModel(-2, 0, 2,-2, 1,    -77.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11548           new NutationModel(-1, 1, 0, 2, 2,      2.0,   0.0,    0.0,     54.0,  0.0,    0.0),
11549           new NutationModel( 0,-1, 2,-1, 2,     94.0,   0.0,    0.0,    -40.0,  0.0,    0.0),
11550 
11551        /* 211-220 */
11552           new NutationModel(-1, 0, 4,-2, 2,    -93.0,   0.0,    0.0,     40.0,  0.0,    0.0),
11553           new NutationModel( 0,-2, 2, 0, 2,    -83.0,   0.0,   10.0,     40.0,  0.0,   -2.0),
11554           new NutationModel(-1, 0, 2, 1, 2,     83.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11555           new NutationModel( 2, 0, 0, 0, 2,    -91.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11556           new NutationModel( 0, 0, 2, 0, 3,    128.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11557           new NutationModel(-2, 0, 4, 0, 2,    -79.0,   0.0,    0.0,     34.0,  0.0,    0.0),
11558           new NutationModel(-1, 0,-2, 0, 1,    -83.0,   0.0,    0.0,     47.0,  0.0,    0.0),
11559           new NutationModel(-1, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -44.0,  0.0,    0.0),
11560           new NutationModel( 3, 0, 0, 0, 1,     83.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11561           new NutationModel(-1, 0, 2, 3, 2,     91.0,   0.0,    0.0,    -39.0,  0.0,    0.0),
11562 
11563        /* 221-230 */
11564           new NutationModel( 2,-1, 2, 0, 1,    -77.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11565           new NutationModel( 0, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11566           new NutationModel( 0,-1, 2, 4, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11567           new NutationModel( 2,-1, 2, 2, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11568           new NutationModel( 0, 2,-2, 2, 0,    -94.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11569           new NutationModel(-1,-1, 2,-1, 1,     68.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11570           new NutationModel( 0,-2, 0, 0, 1,    -61.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11571           new NutationModel( 1, 0, 2,-4, 2,     71.0,   0.0,    0.0,    -31.0,  0.0,    0.0),
11572           new NutationModel( 1,-1, 0,-2, 1,     62.0,   0.0,    0.0,    -34.0,  0.0,    0.0),
11573           new NutationModel(-1,-1, 2, 0, 1,    -63.0,   0.0,    0.0,     33.0,  0.0,    0.0),
11574 
11575        /* 231-240 */
11576           new NutationModel( 1,-1, 2,-2, 2,    -73.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11577           new NutationModel(-2,-1, 0, 4, 0,    115.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11578           new NutationModel(-1, 0, 0, 3, 0,   -103.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11579           new NutationModel(-2,-1, 2, 2, 2,     63.0,   0.0,    0.0,    -28.0,  0.0,    0.0),
11580           new NutationModel( 0, 2, 2, 0, 2,     74.0,   0.0,    0.0,    -32.0,  0.0,    0.0),
11581           new NutationModel( 1, 1, 0, 2, 0,   -103.0,   0.0,   -3.0,      3.0,  0.0,   -1.0),
11582           new NutationModel( 2, 0, 2,-1, 2,    -69.0,   0.0,    0.0,     30.0,  0.0,    0.0),
11583           new NutationModel( 1, 0, 2, 1, 1,     57.0,   0.0,    0.0,    -29.0,  0.0,    0.0),
11584           new NutationModel( 4, 0, 0, 0, 0,     94.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11585           new NutationModel( 2, 1, 2, 0, 1,     64.0,   0.0,    0.0,    -33.0,  0.0,    0.0),
11586 
11587        /* 241-250 */
11588           new NutationModel( 3,-1, 2, 0, 2,    -63.0,   0.0,    0.0,     26.0,  0.0,    0.0),
11589           new NutationModel(-2, 2, 0, 2, 1,    -38.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11590           new NutationModel( 1, 0, 2,-3, 1,    -43.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11591           new NutationModel( 1, 1, 2,-4, 1,    -45.0,   0.0,    0.0,     23.0,  0.0,    0.0),
11592           new NutationModel(-1,-1, 2,-2, 1,     47.0,   0.0,    0.0,    -24.0,  0.0,    0.0),
11593           new NutationModel( 0,-1, 0,-1, 1,    -48.0,   0.0,    0.0,     25.0,  0.0,    0.0),
11594           new NutationModel( 0,-1, 0,-2, 1,     45.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11595           new NutationModel(-2, 0, 0, 0, 2,     56.0,   0.0,    0.0,    -25.0,  0.0,    0.0),
11596           new NutationModel(-2, 0,-2, 2, 0,     88.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11597           new NutationModel(-1, 0,-2, 4, 0,    -75.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11598 
11599        /* 251-260 */
11600           new NutationModel( 1,-2, 0, 0, 0,     85.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11601           new NutationModel( 0, 1, 0, 1, 1,     49.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11602           new NutationModel(-1, 2, 0, 2, 0,    -74.0,   0.0,   -3.0,     -1.0,  0.0,   -1.0),
11603           new NutationModel( 1,-1, 2,-2, 1,    -39.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11604           new NutationModel( 1, 2, 2,-2, 2,     45.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11605           new NutationModel( 2,-1, 2,-2, 2,     51.0,   0.0,    0.0,    -22.0,  0.0,    0.0),
11606           new NutationModel( 1, 0, 2,-1, 1,    -40.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11607           new NutationModel( 2, 1, 2,-2, 1,     41.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11608           new NutationModel(-2, 0, 0,-2, 1,    -42.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11609           new NutationModel( 1,-2, 2, 0, 2,    -51.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11610 
11611        /* 261-270 */
11612           new NutationModel( 0, 1, 2, 1, 1,    -42.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11613           new NutationModel( 1, 0, 4,-2, 1,     39.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11614           new NutationModel(-2, 0, 4, 2, 2,     46.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11615           new NutationModel( 1, 1, 2, 1, 2,    -53.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11616           new NutationModel( 1, 0, 0, 4, 0,     82.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11617           new NutationModel( 1, 0, 2, 2, 0,     81.0,   0.0,   -1.0,     -4.0,  0.0,    0.0),
11618           new NutationModel( 2, 0, 2, 1, 2,     47.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11619           new NutationModel( 3, 1, 2, 0, 2,     53.0,   0.0,    0.0,    -23.0,  0.0,    0.0),
11620           new NutationModel( 4, 0, 2, 0, 1,    -45.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11621           new NutationModel(-2,-1, 2, 0, 0,    -44.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11622 
11623        /* 271-280 */
11624           new NutationModel( 0, 1,-2, 2, 1,    -33.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11625           new NutationModel( 1, 0,-2, 1, 0,    -61.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11626           new NutationModel( 0,-1,-2, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11627           new NutationModel( 2,-1, 0,-2, 1,    -38.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11628           new NutationModel(-1, 0, 2,-1, 2,    -33.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11629           new NutationModel( 1, 0, 2,-3, 2,    -60.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11630           new NutationModel( 0, 1, 2,-2, 3,     48.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11631           new NutationModel( 0, 0, 2,-3, 1,     27.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11632           new NutationModel(-1, 0,-2, 2, 1,     38.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11633           new NutationModel( 0, 0, 2,-4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11634 
11635        /* 281-290 */
11636           new NutationModel(-2, 1, 0, 0, 1,    -29.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11637           new NutationModel(-1, 0, 0,-1, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11638           new NutationModel( 2, 0, 2,-4, 2,    -32.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11639           new NutationModel( 0, 0, 4,-4, 4,     45.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11640           new NutationModel( 0, 0, 4,-4, 2,    -44.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11641           new NutationModel(-1,-2, 0, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11642           new NutationModel(-2, 0, 0, 3, 0,    -51.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11643           new NutationModel( 1, 0,-2, 2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11644           new NutationModel(-3, 0, 2, 2, 2,     44.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11645           new NutationModel(-3, 0, 2, 2, 1,     26.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11646 
11647        /* 291-300 */
11648           new NutationModel(-2, 0, 2, 2, 0,    -60.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11649           new NutationModel( 2,-1, 0, 0, 1,     35.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11650           new NutationModel(-2, 1, 2, 2, 2,    -27.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11651           new NutationModel( 1, 1, 0, 1, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11652           new NutationModel( 0, 1, 4,-2, 2,     36.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11653           new NutationModel(-1, 1, 0,-2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11654           new NutationModel( 0, 0, 0,-4, 1,    -35.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11655           new NutationModel( 1,-1, 0, 2, 1,    -37.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11656           new NutationModel( 1, 1, 0, 2, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11657           new NutationModel(-1, 2, 2, 2, 2,     35.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11658 
11659        /* 301-310 */
11660           new NutationModel( 3, 1, 2,-2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11661           new NutationModel( 0,-1, 0, 4, 0,     65.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11662           new NutationModel( 2,-1, 0, 2, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11663           new NutationModel( 0, 0, 4, 0, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11664           new NutationModel( 2, 0, 4,-2, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11665           new NutationModel(-1,-1, 2, 4, 1,    -30.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11666           new NutationModel( 1, 0, 0, 4, 1,    -32.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11667           new NutationModel( 1,-2, 2, 2, 2,    -31.0,   0.0,    0.0,     13.0,  0.0,    0.0),
11668           new NutationModel( 0, 0, 2, 3, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11669           new NutationModel(-1, 1, 2, 4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11670 
11671        /* 311-320 */
11672           new NutationModel( 3, 0, 0, 2, 0,     49.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11673           new NutationModel(-1, 0, 4, 2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11674           new NutationModel( 1, 1, 2, 2, 1,     23.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11675           new NutationModel(-2, 0, 2, 6, 2,    -43.0,   0.0,    0.0,     18.0,  0.0,    0.0),
11676           new NutationModel( 2, 1, 2, 2, 2,     26.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11677           new NutationModel(-1, 0, 2, 6, 2,    -32.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11678           new NutationModel( 1, 0, 2, 4, 1,    -29.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11679           new NutationModel( 2, 0, 2, 4, 2,    -27.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11680           new NutationModel( 1, 1,-2, 1, 0,     30.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11681           new NutationModel(-3, 1, 2, 1, 2,    -11.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11682 
11683        /* 321-330 */
11684           new NutationModel( 2, 0,-2, 0, 2,    -21.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11685           new NutationModel(-1, 0, 0, 1, 2,    -34.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11686           new NutationModel(-4, 0, 2, 2, 1,    -10.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11687           new NutationModel(-1,-1, 0, 1, 0,    -36.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11688           new NutationModel( 0, 0,-2, 2, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11689           new NutationModel( 1, 0, 0,-1, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11690           new NutationModel( 0,-1, 2,-2, 3,    -21.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11691           new NutationModel(-2, 1, 2, 0, 0,    -29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11692           new NutationModel( 0, 0, 2,-2, 4,    -15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11693           new NutationModel(-2,-2, 0, 2, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11694 
11695        /* 331-340 */
11696           new NutationModel(-2, 0,-2, 4, 0,     28.0,   0.0,    0.0,      0.0,  0.0,   -2.0),
11697           new NutationModel( 0,-2,-2, 2, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11698           new NutationModel( 1, 2, 0,-2, 1,    -22.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11699           new NutationModel( 3, 0, 0,-4, 1,    -14.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11700           new NutationModel(-1, 1, 2,-2, 2,     24.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11701           new NutationModel( 1,-1, 2,-4, 1,     11.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11702           new NutationModel( 1, 1, 0,-2, 2,     14.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11703           new NutationModel(-3, 0, 2, 0, 0,     24.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11704           new NutationModel(-3, 0, 2, 0, 2,     18.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11705           new NutationModel(-2, 0, 0, 1, 0,    -38.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11706 
11707        /* 341-350 */
11708           new NutationModel( 0, 0,-2, 1, 0,    -31.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11709           new NutationModel(-3, 0, 0, 2, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11710           new NutationModel(-1,-1,-2, 2, 0,     29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11711           new NutationModel( 0, 1, 2,-4, 1,    -18.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11712           new NutationModel( 2, 1, 0,-4, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11713           new NutationModel( 0, 2, 0,-2, 1,    -17.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11714           new NutationModel( 1, 0, 0,-3, 1,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11715           new NutationModel(-2, 0, 2,-2, 2,     16.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11716           new NutationModel(-2,-1, 0, 0, 1,     22.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11717           new NutationModel(-4, 0, 0, 2, 0,     20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11718 
11719        /* 351-360 */
11720           new NutationModel( 1, 1, 0,-4, 1,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11721           new NutationModel(-1, 0, 2,-4, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11722           new NutationModel( 0, 0, 4,-4, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11723           new NutationModel( 0, 3, 2,-2, 2,      0.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11724           new NutationModel(-3,-1, 0, 4, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11725           new NutationModel(-3, 0, 0, 4, 1,     19.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11726           new NutationModel( 1,-1,-2, 2, 0,    -34.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11727           new NutationModel(-1,-1, 0, 2, 2,    -20.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11728           new NutationModel( 1,-2, 0, 0, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11729           new NutationModel( 1,-1, 0, 0, 2,    -18.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11730 
11731        /* 361-370 */
11732           new NutationModel( 0, 0, 0, 1, 2,     13.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11733           new NutationModel(-1,-1, 2, 0, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11734           new NutationModel( 1,-2, 2,-2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11735           new NutationModel( 0,-1, 2,-1, 1,     15.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11736           new NutationModel(-1, 0, 2, 0, 3,    -11.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11737           new NutationModel( 1, 1, 0, 0, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11738           new NutationModel(-1, 1, 2, 0, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11739           new NutationModel( 1, 2, 0, 0, 0,    -35.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11740           new NutationModel(-1, 2, 2, 0, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11741           new NutationModel(-1, 0, 4,-2, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11742 
11743        /* 371-380 */
11744           new NutationModel( 3, 0, 2,-4, 2,    -26.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11745           new NutationModel( 1, 2, 2,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11746           new NutationModel( 1, 0, 4,-4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11747           new NutationModel(-2,-1, 0, 4, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11748           new NutationModel( 0,-1, 0, 2, 2,    -21.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11749           new NutationModel(-2, 1, 0, 4, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11750           new NutationModel(-2,-1, 2, 2, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11751           new NutationModel( 2, 0,-2, 2, 0,    -29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11752           new NutationModel( 1, 0, 0, 1, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11753           new NutationModel( 0, 1, 0, 2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11754 
11755        /* 381-390 */
11756           new NutationModel( 1,-1, 2,-1, 2,     22.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11757           new NutationModel(-2, 0, 4, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11758           new NutationModel( 2, 1, 0, 0, 1,    -20.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11759           new NutationModel( 0, 1, 2, 0, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11760           new NutationModel( 0,-1, 4,-2, 2,    -17.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11761           new NutationModel( 0, 0, 4,-2, 4,     15.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11762           new NutationModel( 0, 2, 2, 0, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11763           new NutationModel(-3, 0, 0, 6, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11764           new NutationModel(-1,-1, 0, 4, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11765           new NutationModel( 1,-2, 0, 2, 0,     25.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11766 
11767        /* 391-400 */
11768           new NutationModel(-1, 0, 0, 4, 2,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11769           new NutationModel(-1,-2, 2, 2, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11770           new NutationModel(-1, 0, 0,-2, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11771           new NutationModel( 1, 0,-2,-2, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11772           new NutationModel( 0, 0,-2,-2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11773           new NutationModel(-2, 0,-2, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11774           new NutationModel( 0, 0, 0, 3, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11775           new NutationModel( 0, 0, 0, 3, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11776           new NutationModel(-1, 1, 0, 4, 0,    -22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11777           new NutationModel(-1,-1, 2, 2, 0,     28.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11778 
11779        /* 401-410 */
11780           new NutationModel(-2, 0, 2, 3, 2,     15.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11781           new NutationModel( 1, 0, 0, 2, 2,     23.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11782           new NutationModel( 0,-1, 2, 1, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11783           new NutationModel( 3,-1, 0, 0, 0,     29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11784           new NutationModel( 2, 0, 0, 1, 0,    -25.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11785           new NutationModel( 1,-1, 2, 0, 0,     22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11786           new NutationModel( 0, 0, 2, 1, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11787           new NutationModel( 1, 0, 2, 0, 3,     15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11788           new NutationModel( 3, 1, 0, 0, 0,    -23.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11789           new NutationModel( 3,-1, 2,-2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11790 
11791        /* 411-420 */
11792           new NutationModel( 2, 0, 2,-1, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11793           new NutationModel( 1, 1, 2, 0, 0,    -19.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11794           new NutationModel( 0, 0, 4,-1, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11795           new NutationModel( 1, 2, 2, 0, 2,     21.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11796           new NutationModel(-2, 0, 0, 6, 0,     23.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11797           new NutationModel( 0,-1, 0, 4, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11798           new NutationModel(-2,-1, 2, 4, 1,    -19.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11799           new NutationModel( 0,-2, 2, 2, 1,    -22.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11800           new NutationModel( 0,-1, 2, 2, 0,     27.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11801           new NutationModel(-1, 0, 2, 3, 1,     16.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11802 
11803        /* 421-430 */
11804           new NutationModel(-2, 1, 2, 4, 2,     19.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11805           new NutationModel( 2, 0, 0, 2, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11806           new NutationModel( 2,-2, 2, 0, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11807           new NutationModel(-1, 1, 2, 3, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11808           new NutationModel( 3, 0, 2,-1, 2,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11809           new NutationModel( 4, 0, 2,-2, 1,     18.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11810           new NutationModel(-1, 0, 0, 6, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11811           new NutationModel(-1,-2, 2, 4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11812           new NutationModel(-3, 0, 2, 6, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11813           new NutationModel(-1, 0, 2, 4, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11814 
11815        /* 431-440 */
11816           new NutationModel( 3, 0, 0, 2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11817           new NutationModel( 3,-1, 2, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11818           new NutationModel( 3, 0, 2, 0, 0,     30.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11819           new NutationModel( 1, 0, 4, 0, 2,     24.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11820           new NutationModel( 5, 0, 2,-2, 2,     10.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11821           new NutationModel( 0,-1, 2, 4, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11822           new NutationModel( 2,-1, 2, 2, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11823           new NutationModel( 0, 1, 2, 4, 2,     17.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11824           new NutationModel( 1,-1, 2, 4, 2,    -24.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11825           new NutationModel( 3,-1, 2, 2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11826 
11827        /* 441-450 */
11828           new NutationModel( 3, 0, 2, 2, 1,    -24.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11829           new NutationModel( 5, 0, 2, 0, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11830           new NutationModel( 0, 0, 2, 6, 2,    -13.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11831           new NutationModel( 4, 0, 2, 2, 2,    -15.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11832           new NutationModel( 0,-1, 1,-1, 1,      0.0,   0.0,-1988.0,      0.0,  0.0,-1679.0),
11833           new NutationModel(-1, 0, 1, 0, 3,      0.0,   0.0,  -63.0,      0.0,  0.0,  -27.0),
11834           new NutationModel( 0,-2, 2,-2, 3,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11835           new NutationModel( 1, 0,-1, 0, 1,      0.0,   0.0,    5.0,      0.0,  0.0,    4.0),
11836           new NutationModel( 2,-2, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11837           new NutationModel(-1, 0, 1, 0, 2,      0.0,   0.0,  364.0,      0.0,  0.0,  176.0),
11838 
11839        /* 451-460 */
11840           new NutationModel(-1, 0, 1, 0, 1,      0.0,   0.0,-1044.0,      0.0,  0.0, -891.0),
11841           new NutationModel(-1,-1, 2,-1, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11842           new NutationModel(-2, 2, 0, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11843           new NutationModel(-1, 0, 1, 0, 0,      0.0,   0.0,  330.0,      0.0,  0.0,    0.0),
11844           new NutationModel(-4, 1, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11845           new NutationModel(-3, 0, 2, 1, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11846           new NutationModel(-2,-1, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11847           new NutationModel( 1, 0,-2, 1, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11848           new NutationModel( 2,-1,-2, 0, 1,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11849           new NutationModel(-4, 0, 2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11850 
11851        /* 461-470 */
11852           new NutationModel(-3, 1, 0, 3, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11853           new NutationModel(-1, 0,-1, 2, 0,      0.0,   0.0,    5.0,      0.0,  0.0,    0.0),
11854           new NutationModel( 0,-2, 0, 0, 2,      0.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11855           new NutationModel( 0,-2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11856           new NutationModel(-3, 0, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11857           new NutationModel(-2,-1, 0, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11858           new NutationModel(-1, 0,-2, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11859           new NutationModel(-4, 0, 0, 4, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11860           new NutationModel( 2, 1,-2, 0, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11861           new NutationModel( 2,-1, 0,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11862 
11863        /* 471-480 */
11864           new NutationModel( 0, 0, 1,-1, 0,     -5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11865           new NutationModel(-1, 2, 0, 1, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11866           new NutationModel(-2, 1, 2, 0, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11867           new NutationModel( 1, 1, 0,-1, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11868           new NutationModel( 1, 0, 1,-2, 1,      0.0,   0.0,  -12.0,      0.0,  0.0,  -10.0),
11869           new NutationModel( 0, 2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11870           new NutationModel( 1,-1, 2,-3, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11871           new NutationModel(-1, 1, 2,-1, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11872           new NutationModel(-2, 0, 4,-2, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11873           new NutationModel(-2, 0, 4,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11874 
11875        /* 481-490 */
11876           new NutationModel(-2,-2, 0, 2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11877           new NutationModel(-2, 0,-2, 4, 0,      0.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11878           new NutationModel( 1, 2, 2,-4, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11879           new NutationModel( 1, 1, 2,-4, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11880           new NutationModel(-1, 2, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11881           new NutationModel( 2, 0, 0,-3, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11882           new NutationModel(-1, 2, 0, 0, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11883           new NutationModel( 0, 0, 0,-2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11884           new NutationModel(-1,-1, 2,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11885           new NutationModel(-1, 1, 0, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11886 
11887        /* 491-500 */
11888           new NutationModel( 0, 0, 0,-1, 2,     -8.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11889           new NutationModel(-2, 1, 0, 1, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11890           new NutationModel( 1,-2, 0,-2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11891           new NutationModel( 1, 0,-2, 0, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11892           new NutationModel(-3, 1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11893           new NutationModel(-1, 1,-2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11894           new NutationModel(-1,-1, 0, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11895           new NutationModel(-3, 0, 0, 2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11896           new NutationModel(-3,-1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11897           new NutationModel( 2, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11898 
11899        /* 501-510 */
11900           new NutationModel( 0, 1, 2,-4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11901           new NutationModel( 2, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11902           new NutationModel(-2, 1, 2,-2, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11903           new NutationModel( 0,-1, 2,-4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11904           new NutationModel( 0, 1, 0,-2, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11905           new NutationModel(-1, 0, 0,-2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11906           new NutationModel( 2, 0,-2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11907           new NutationModel(-4, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11908           new NutationModel(-1,-1, 0,-1, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11909           new NutationModel( 0, 0,-2, 0, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11910 
11911        /* 511-520 */
11912           new NutationModel(-3, 0, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11913           new NutationModel(-1, 0,-2, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11914           new NutationModel(-2, 0,-2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11915           new NutationModel( 0, 0,-4, 2, 0,      8.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11916           new NutationModel(-2,-1,-2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11917           new NutationModel( 1, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11918           new NutationModel(-1, 0, 2,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11919           new NutationModel( 1, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11920           new NutationModel( 2, 1, 2,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11921           new NutationModel( 2, 1, 2,-4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11922 
11923        /* 521-530 */
11924           new NutationModel( 0, 1, 4,-4, 4,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11925           new NutationModel( 0, 1, 4,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11926           new NutationModel(-1,-1,-2, 4, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11927           new NutationModel(-1,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11928           new NutationModel(-1, 0,-2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11929           new NutationModel(-2,-1, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11930           new NutationModel( 0, 0,-2, 3, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11931           new NutationModel(-2, 0, 0, 3, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11932           new NutationModel( 0,-1, 0, 1, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11933           new NutationModel(-3, 0, 2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11934 
11935        /* 531-540 */
11936           new NutationModel( 1, 1,-2, 2, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11937           new NutationModel(-1, 1, 0, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11938           new NutationModel( 1,-2, 2,-2, 1,     10.0,   0.0,   13.0,      6.0,  0.0,   -5.0),
11939           new NutationModel( 0, 0, 1, 0, 2,      0.0,   0.0,   30.0,      0.0,  0.0,   14.0),
11940           new NutationModel( 0, 0, 1, 0, 1,      0.0,   0.0, -162.0,      0.0,  0.0, -138.0),
11941           new NutationModel( 0, 0, 1, 0, 0,      0.0,   0.0,   75.0,      0.0,  0.0,    0.0),
11942           new NutationModel(-1, 2, 0, 2, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11943           new NutationModel( 0, 0, 2, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11944           new NutationModel(-2, 0, 2, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11945           new NutationModel( 2, 0, 0,-1, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11946 
11947        /* 541-550 */
11948           new NutationModel( 3, 0, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11949           new NutationModel( 1, 0, 2,-2, 3,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11950           new NutationModel( 1, 2, 0, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11951           new NutationModel( 2, 0, 2,-3, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11952           new NutationModel(-1, 1, 4,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11953           new NutationModel(-2,-2, 0, 4, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11954           new NutationModel( 0,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11955           new NutationModel( 0, 0,-2, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11956           new NutationModel(-1,-1, 0, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11957           new NutationModel(-2, 0, 0, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11958 
11959        /* 551-560 */
11960           new NutationModel(-1, 0, 0, 3, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11961           new NutationModel( 2,-2, 0, 0, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11962           new NutationModel( 1,-1, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11963           new NutationModel(-1, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11964           new NutationModel( 0,-2, 2, 0, 1,     -6.0,   0.0,   -3.0,      3.0,  0.0,    1.0),
11965           new NutationModel(-1, 0, 1, 2, 1,      0.0,   0.0,   -3.0,      0.0,  0.0,   -2.0),
11966           new NutationModel(-1, 1, 0, 3, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11967           new NutationModel(-1,-1, 2, 1, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11968           new NutationModel( 0,-1, 2, 0, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11969           new NutationModel(-2, 1, 2, 2, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11970 
11971        /* 561-570 */
11972           new NutationModel( 2,-2, 2,-2, 2,     -1.0,   0.0,    3.0,      3.0,  0.0,   -1.0),
11973           new NutationModel( 1, 1, 0, 1, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11974           new NutationModel( 1, 0, 1, 0, 1,      0.0,   0.0,  -13.0,      0.0,  0.0,  -11.0),
11975           new NutationModel( 1, 0, 1, 0, 0,      3.0,   0.0,    6.0,      0.0,  0.0,    0.0),
11976           new NutationModel( 0, 2, 0, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11977           new NutationModel( 2,-1, 2,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11978           new NutationModel( 0,-1, 4,-2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11979           new NutationModel( 0, 0, 4,-2, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11980           new NutationModel( 0, 1, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11981           new NutationModel( 4, 0, 2,-4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11982 
11983        /* 571-580 */
11984           new NutationModel( 2, 2, 2,-2, 2,      8.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11985           new NutationModel( 2, 0, 4,-4, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11986           new NutationModel(-1,-2, 0, 4, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11987           new NutationModel(-1,-3, 2, 2, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11988           new NutationModel(-3, 0, 2, 4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11989           new NutationModel(-3, 0, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11990           new NutationModel(-1,-1, 0,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11991           new NutationModel(-3, 0, 0, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11992           new NutationModel(-3, 0,-2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11993           new NutationModel( 0, 1, 0,-4, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11994 
11995        /* 581-590 */
11996           new NutationModel(-2, 1, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11997           new NutationModel(-4, 0, 0, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11998           new NutationModel(-1, 0, 0,-4, 1,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11999           new NutationModel(-3, 0, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12000           new NutationModel( 0, 0, 0, 3, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12001           new NutationModel(-1, 1, 0, 4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12002           new NutationModel( 1,-2, 2, 0, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12003           new NutationModel( 0, 1, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12004           new NutationModel(-1, 0, 2, 2, 3,      6.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12005           new NutationModel( 0, 0, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12006 
12007        /* 591-600 */
12008           new NutationModel(-2, 0, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12009           new NutationModel(-1, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12010           new NutationModel( 3, 0, 0, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12011           new NutationModel( 2, 1, 0, 1, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12012           new NutationModel( 2,-1, 2,-1, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12013           new NutationModel( 0, 0, 2, 0, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12014           new NutationModel( 0, 0, 3, 0, 3,      0.0,   0.0,  -26.0,      0.0,  0.0,  -11.0),
12015           new NutationModel( 0, 0, 3, 0, 2,      0.0,   0.0,  -10.0,      0.0,  0.0,   -5.0),
12016           new NutationModel(-1, 2, 2, 2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12017           new NutationModel(-1, 0, 4, 0, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12018 
12019        /* 601-610 */
12020           new NutationModel( 1, 2, 2, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12021           new NutationModel( 3, 1, 2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12022           new NutationModel( 1, 1, 4,-2, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12023           new NutationModel(-2,-1, 0, 6, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12024           new NutationModel( 0,-2, 0, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12025           new NutationModel(-2, 0, 0, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12026           new NutationModel(-2,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12027           new NutationModel( 0,-3, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12028           new NutationModel( 0, 0, 0, 4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12029           new NutationModel(-1,-1, 2, 3, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12030 
12031        /* 611-620 */
12032           new NutationModel(-2, 0, 2, 4, 0,     13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12033           new NutationModel( 2,-1, 0, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12034           new NutationModel( 1, 0, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12035           new NutationModel( 0, 1, 0, 4, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12036           new NutationModel( 0, 1, 0, 4, 0,    -11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12037           new NutationModel( 1,-1, 2, 1, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12038           new NutationModel( 0, 0, 2, 2, 3,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12039           new NutationModel( 1, 0, 2, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12040           new NutationModel(-1, 0, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12041           new NutationModel(-2, 0, 4, 2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12042 
12043        /* 621-630 */
12044           new NutationModel( 2, 1, 0, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12045           new NutationModel( 2, 1, 0, 2, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12046           new NutationModel( 2,-1, 2, 0, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12047           new NutationModel( 1, 0, 2, 1, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12048           new NutationModel( 0, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12049           new NutationModel( 2, 0, 2, 0, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12050           new NutationModel( 3, 0, 2, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12051           new NutationModel( 1, 0, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12052           new NutationModel( 1, 0, 3, 0, 3,      0.0,   0.0,   -5.0,      0.0,  0.0,   -2.0),
12053           new NutationModel( 1, 1, 2, 1, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12054 
12055        /* 631-640 */
12056           new NutationModel( 0, 2, 2, 2, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12057           new NutationModel( 2, 1, 2, 0, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12058           new NutationModel( 2, 0, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12059           new NutationModel( 4, 1, 2,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12060           new NutationModel(-1,-1, 0, 6, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12061           new NutationModel(-3,-1, 2, 6, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12062           new NutationModel(-1, 0, 0, 6, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12063           new NutationModel(-3, 0, 2, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12064           new NutationModel( 1,-1, 0, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12065           new NutationModel( 1,-1, 0, 4, 0,     12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12066 
12067        /* 641-650 */
12068           new NutationModel(-2, 0, 2, 5, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12069           new NutationModel( 1,-2, 2, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12070           new NutationModel( 3,-1, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12071           new NutationModel( 1,-1, 2, 2, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12072           new NutationModel( 0, 0, 2, 3, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12073           new NutationModel(-1, 1, 2, 4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12074           new NutationModel( 0, 1, 2, 3, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12075           new NutationModel(-1, 0, 4, 2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12076           new NutationModel( 2, 0, 2, 1, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12077           new NutationModel( 5, 0, 0, 0, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12078 
12079        /* 651-660 */
12080           new NutationModel( 2, 1, 2, 1, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12081           new NutationModel( 1, 0, 4, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12082           new NutationModel( 3, 1, 2, 0, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12083           new NutationModel( 3, 0, 4,-2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12084           new NutationModel(-2,-1, 2, 6, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12085           new NutationModel( 0, 0, 0, 6, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12086           new NutationModel( 0,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12087           new NutationModel(-2, 0, 2, 6, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12088           new NutationModel( 2, 0, 0, 4, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12089           new NutationModel( 2, 0, 0, 4, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12090 
12091        /* 661-670 */
12092           new NutationModel( 2,-2, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12093           new NutationModel( 0, 0, 2, 4, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12094           new NutationModel( 1, 0, 2, 3, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12095           new NutationModel( 4, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12096           new NutationModel( 2, 0, 2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12097           new NutationModel( 0, 0, 4, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12098           new NutationModel( 4,-1, 2, 0, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12099           new NutationModel( 3, 0, 2, 1, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12100           new NutationModel( 2, 1, 2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12101           new NutationModel( 4, 1, 2, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12102 
12103        /* 671-678 */
12104           new NutationModel(-1,-1, 2, 6, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12105           new NutationModel(-1, 0, 2, 6, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12106           new NutationModel( 1,-1, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12107           new NutationModel( 1, 1, 2, 4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12108           new NutationModel( 3, 1, 2, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12109           new NutationModel( 5, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12110           new NutationModel( 2,-1, 2, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12111           new NutationModel( 2, 0, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0)
12112        };
12113 
12114     /* Number of terms in the luni-solar nutation model */
12115        final int NLS = xls.length;
12116 
12117     /* ------------------------ */
12118     /* Planetary nutation model */
12119     /* ------------------------ */
12120 
12121     /* The units for the sine and cosine coefficients are */
12122     /* 0.1 microarcsecond                                 */
12123 
12124         final class PlanetaryNutModel {
12125          final int nl,               /* coefficients of l, F, D and Omega */
12126               nf,
12127               nd,
12128               nom,
12129               nme,              /* coefficients of planetary longitudes */
12130               nve,
12131               nea,
12132               nma,
12133               nju,
12134               nsa,
12135               nur,
12136               nne,
12137               npa;              /* coefficient of general precession */
12138           final int sp,cp;            /* longitude sin, cos coefficients */
12139           final int se,ce;            /* obliquity sin, cos coefficients */
12140           public PlanetaryNutModel(          int nl,               
12141                   int nf,
12142                   int nd,
12143                   int nom,
12144                   int nme,     
12145                   int nve,
12146                   int nea,
12147                   int nma,
12148                   int nju,
12149                   int nsa,
12150                   int nur,
12151                   int nne,
12152                   int npa,              
12153               int sp,int cp,           
12154               int se,int ce           
12155 ) {
12156               this.nl = nl;               /* coefficients of l, F, D and Omega */
12157               this.nf = nf;
12158               this.nd = nd;
12159               this.nom = nom;
12160               this.nme = nme;              /* coefficients of planetary longitudes */
12161               this.nve = nve;
12162               this.nea = nea;
12163               this.nma = nma;
12164               this.nju = nju;
12165               this.nsa = nsa;
12166               this.nur = nur;
12167               this.nne = nne;
12168               this.npa = npa;              /* coefficient of general precession */
12169            this.sp = sp; this.cp = cp;            /* longitude sin, cos coefficients */
12170            this.se = se; this.ce = ce;            /* obliquity sin, cos coefficients */
12171       
12172         }
12173        }
12174        
12175        PlanetaryNutModel xpl[] = {
12176 
12177        /* 1-10 */
12178           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 0, 1440,   0,    0,   0),
12179           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 16,-4,-5, 0, 0, 2,   56,-117,  -42, -40),
12180           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 2,  125, -43,    0, -54),
12181           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0,-1, 2, 2,    0,   5,    0,   0),
12182           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-1,-5, 0, 0, 2,    3,  -7,   -3,   0),
12183           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 1,    3,   0,    0,  -2),
12184           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  3, -8, 3, 0, 0, 0, 0, -114,   0,    0,  61),
12185           new PlanetaryNutModel(-1, 0, 0, 0, 0, 10, -3,  0, 0, 0, 0, 0, 0, -219,  89,    0,   0),
12186           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 6,-3, 0, 2,   -3,   0,    0,   0),
12187           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0, -462,1604,    0,   0),
12188 
12189        /* 11-20 */
12190           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -5,  8,-3, 0, 0, 0, 0,   99,   0,    0, -53),
12191           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-3, 0, 0, 0, 1,   -3,   0,    0,   2),
12192           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 1, 5, 0, 0, 2,    0,   6,    2,   0),
12193           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  4, 0, 0, 0, 0, 2,    3,   0,    0,   0),
12194           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 2,  -12,   0,    0,   0),
12195           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 1,   14,-218,  117,   8),
12196           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2,-5, 0, 0, 0,   31,-481, -257, -17),
12197           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 0, -491, 128,    0,   0),
12198           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 5, 0, 0, 0,-3084,5123, 2735,1647),
12199           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 1,-1444,2409,-1286,-771),
12200 
12201        /* 21-30 */
12202           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 2,   11, -24,  -11,  -9),
12203           new PlanetaryNutModel( 2,-1,-1, 0, 0,  0,  3, -7, 0, 0, 0, 0, 0,   26,  -9,    0,   0),
12204           new PlanetaryNutModel( 1, 0,-2, 0, 0, 19,-21,  3, 0, 0, 0, 0, 0,  103, -60,    0,   0),
12205           new PlanetaryNutModel( 0, 1,-1, 1, 0,  2, -4,  0,-3, 0, 0, 0, 0,    0, -13,   -7,   0),
12206           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -26, -29,  -16,  14),
12207           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-4,10, 0, 0, 0,    9, -27,  -14,  -5),
12208           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0, 0,-5, 0, 0, 0,   12,   0,    0,  -6),
12209           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -7,  4, 0, 0, 0, 0, 0,   -7,   0,    0,   0),
12210           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1,-1, 0, 0, 0,    0,  24,    0,   0),
12211           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,  284,   0,    0,-151),
12212 
12213        /* 31-40 */
12214           new PlanetaryNutModel(-1, 0, 0, 0, 0, 18,-16,  0, 0, 0, 0, 0, 0,  226, 101,    0,   0),
12215           new PlanetaryNutModel(-2, 1, 1, 2, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -8,   -2,   0),
12216           new PlanetaryNutModel(-1, 1,-1, 1, 0, 18,-17,  0, 0, 0, 0, 0, 0,    0,  -6,   -3,   0),
12217           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12218           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 2,  -41, 175,   76,  17),
12219           new PlanetaryNutModel( 0, 2,-2, 2, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,  15,    6,   0),
12220           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 1,  425, 212, -133, 269),
12221           new PlanetaryNutModel( 0, 1,-1, 1, 0, -8, 12,  0, 0, 0, 0, 0, 0, 1200, 598,  319,-641),
12222           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 0,  235, 334,    0,   0),
12223           new PlanetaryNutModel( 0, 1,-1, 1, 0,  8,-14,  0, 0, 0, 0, 0, 0,   11, -12,   -7,  -6),
12224 
12225        /* 41-50 */
12226           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 1,    5,  -6,    3,   3),
12227           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-4, 5, 0, 0, 0,   -5,   0,    0,   3),
12228           new PlanetaryNutModel(-2, 0, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12229           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 1, 0, 0, 0,   15,   0,    0,   0),
12230           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 2, 0, 0, 0, 0,   13,   0,    0,  -7),
12231           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-4, 3, 0, 0, 0,   -6,  -9,    0,   0),
12232           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,  266, -78,    0,   0),
12233           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  2, 0, 0, 0, 0, 0, -460,-435, -232, 246),
12234           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -2,  2, 0, 0, 0, 0, 0,    0,  15,    7,   0),
12235           new PlanetaryNutModel(-1, 1, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12236 
12237        /* 51-60 */
12238           new PlanetaryNutModel(-1, 0, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0, 131,    0,   0),
12239           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2,-2, 0, 0, 0,    4,   0,    0,   0),
12240           new PlanetaryNutModel(-2, 2, 0, 2, 0,  0, -5,  9, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12241           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0,-1, 0, 0,    0,   4,    2,   0),
12242           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 1, 0, 0,    0,   3,    0,   0),
12243           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 2, 0,  -17, -19,  -10,   9),
12244           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 1,   -9, -11,    6,  -5),
12245           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 2,   -6,   0,    0,   3),
12246           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -16,   8,    0,   0),
12247           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 2, 0, 0, 0,    0,   3,    0,   0),
12248 
12249        /* 61-70 */
12250           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 2, 0, 0, 0,   11,  24,   11,  -5),
12251           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -9, 17, 0, 0, 0, 0, 0,   -3,  -4,   -2,   1),
12252           new PlanetaryNutModel( 0, 0, 0, 2, 0, -3,  5,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12253           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 2, 0, 0, 0,    0,  -8,   -4,   0),
12254           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1,-2, 0, 0, 0,    0,   3,    0,   0),
12255           new PlanetaryNutModel( 1, 0,-2, 0, 0, 17,-16,  0,-2, 0, 0, 0, 0,    0,   5,    0,   0),
12256           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1,-3, 0, 0, 0,    0,   3,    2,   0),
12257           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  5, -6, 0, 0, 0, 0, 0,   -6,   4,    2,   3),
12258           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  9,-13, 0, 0, 0, 0, 0,   -3,  -5,    0,   0),
12259           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 1, 0, 0, 0,   -5,   0,    0,   2),
12260 
12261        /* 71-80 */
12262           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0, 1, 0, 0, 0,    4,  24,   13,  -2),
12263           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 1, 0, 0, 0,  -42,  20,    0,   0),
12264           new PlanetaryNutModel( 0,-2, 2, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,  -10, 233,    0,   0),
12265           new PlanetaryNutModel( 0,-1, 1, 1, 0,  5, -7,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12266           new PlanetaryNutModel(-2, 0, 2, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   78, -18,    0,   0),
12267           new PlanetaryNutModel( 2, 1,-3, 1, 0, -6,  7,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12268           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  0,  0, 1, 0, 0, 0, 0,    0,  -3,   -1,   0),
12269           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  1,  0, 1, 0, 0, 0, 0,    0,  -4,   -2,   1),
12270           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 2, 0, 0,    0,  -8,   -4,  -1),
12271           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 1,    0,  -5,    3,   0),
12272 
12273        /* 81-90 */
12274           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 2,   -7,   0,    0,   3),
12275           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 2,  -14,   8,    3,   6),
12276           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 1,    0,   8,   -4,   0),
12277           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -9, 15, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12278           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   45, -22,    0,   0),
12279           new PlanetaryNutModel( 1,-1,-1, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12280           new PlanetaryNutModel( 2, 0,-2, 0, 0,  2, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12281           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-5, 5, 0, 0, 0,    0,   3,    0,   0),
12282           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -6,  8, 0, 0, 0, 0, 0,    3,   5,    3,  -2),
12283           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   89, -16,   -9, -48),
12284 
12285        /* 91-100 */
12286           new PlanetaryNutModel(-2, 1, 1, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,    0,   3,    0,   0),
12287           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-3, 0, 0, 0, 0,   -3,   7,    4,   2),
12288           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0, -349, -62,    0,   0),
12289           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  6, -8, 0, 0, 0, 0, 0,  -15,  22,    0,   0),
12290           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-1,-5, 0, 0, 0,   -3,   0,    0,   0),
12291           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,  -53,   0,    0,   0),
12292           new PlanetaryNutModel(-1, 1, 1, 1, 0,-20, 20,  0, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12293           new PlanetaryNutModel( 1, 0,-2, 0, 0, 20,-21,  0, 0, 0, 0, 0, 0,    0,  -8,    0,   0),
12294           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  8,-15, 0, 0, 0, 0, 0,   15,  -7,   -4,  -8),
12295           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,-10, 15, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12296 
12297        /* 101-110 */
12298           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,  -21, -78,    0,   0),
12299           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 1, 0, 0, 0, 0,   20, -70,  -37, -11),
12300           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,   6,    3,   0),
12301           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 4, 0, 0, 0,    5,   3,    2,  -2),
12302           new PlanetaryNutModel( 2, 0,-2, 1, 0, -6,  8,  0, 0, 0, 0, 0, 0,  -17,  -4,   -2,   9),
12303           new PlanetaryNutModel( 0,-2, 2, 1, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   6,    3,   0),
12304           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0,-1, 0, 0, 1,   32,  15,   -8,  17),
12305           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-1, 0, 0, 0,  174,  84,   45, -93),
12306           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 0,   11,  56,    0,   0),
12307           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 1, 0, 0, 0,  -66, -12,   -6,  35),
12308 
12309        /* 111-120 */
12310           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 1,   47,   8,    4, -25),
12311           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 2,    0,   8,    4,   0),
12312           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -9, 13, 0, 0, 0, 0, 0,   10, -22,  -12,  -5),
12313           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  7,-13, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12314           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,  -24,  12,    0,   0),
12315           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  9,-17, 0, 0, 0, 0, 0,    5,  -6,    0,   0),
12316           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -9, 17, 0, 0, 0, 0, 2,    3,   0,    0,  -2),
12317           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    4,   3,    1,  -2),
12318           new PlanetaryNutModel( 1, 0,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  29,   15,   0),
12319           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -1,  2, 0, 0, 0, 0, 0,   -5,  -4,   -2,   2),
12320 
12321        /* 121-130 */
12322           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  0,  2, 0, 0, 0, 0, 0,    8,  -3,   -1,  -5),
12323           new PlanetaryNutModel( 0,-2, 2, 0, 1,  0, -2,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12324           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 2, 0, 0, 0, 0,   10,   0,    0,   0),
12325           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 1, 0, 0, 0,    3,   0,    0,  -2),
12326           new PlanetaryNutModel(-2, 0, 2, 1, 0,  3, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   3),
12327           new PlanetaryNutModel( 0, 0, 0, 1, 0,  8,-13,  0, 0, 0, 0, 0, 0,   46,  66,   35, -25),
12328           new PlanetaryNutModel( 0,-1, 1, 0, 0,  8,-12,  0, 0, 0, 0, 0, 0,  -14,   7,    0,   0),
12329           new PlanetaryNutModel( 0, 2,-2, 1, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12330           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12331           new PlanetaryNutModel(-1, 0, 0, 1, 0, 18,-16,  0, 0, 0, 0, 0, 0,  -68, -34,  -18,  36),
12332 
12333        /* 131-140 */
12334           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 1, 0, 0, 0,    0,  14,    7,   0),
12335           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -7,  4, 0, 0, 0, 0, 0,   10,  -6,   -3,  -5),
12336           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0, -3,  7, 0, 0, 0, 0, 0,   -5,  -4,   -2,   3),
12337           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-2, 5, 0, 0, 0,   -3,   5,    2,   1),
12338           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-2, 5, 0, 0, 0,   76,  17,    9, -41),
12339           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,   84, 298,  159, -45),
12340           new PlanetaryNutModel( 1, 0, 0, 1, 0,-10,  3,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12341           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12342           new PlanetaryNutModel(-1, 0, 0, 1, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12343           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,  -82, 292,  156,  44),
12344 
12345        /* 141-150 */
12346           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 2,-5, 0, 0, 0,  -73,  17,    9,  39),
12347           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,   -9, -16,    0,   0),
12348           new PlanetaryNutModel( 2,-1,-1, 1, 0,  0,  3, -7, 0, 0, 0, 0, 0,    3,   0,   -1,  -2),
12349           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-5, 0, 0, 0,   -3,   0,    0,   0),
12350           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  7, -4, 0, 0, 0, 0, 0,   -9,  -5,   -3,   5),
12351           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0, -439,   0,    0,   0),
12352           new PlanetaryNutModel( 1, 0, 0, 1, 0,-18, 16,  0, 0, 0, 0, 0, 0,   57, -28,  -15, -30),
12353           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -6,   -3,   0),
12354           new PlanetaryNutModel( 0, 1,-1, 2, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12355           new PlanetaryNutModel( 0, 0, 0, 1, 0, -8, 13,  0, 0, 0, 0, 0, 0,  -40,  57,   30,  21),
12356 
12357        /* 151-160 */
12358           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 1,   23,   7,    3, -13),
12359           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  0, -2, 0, 0, 0, 0, 0,  273,  80,   43,-146),
12360           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 0, -449, 430,    0,   0),
12361           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,   -8, -47,  -25,   4),
12362           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  2, 0, 0, 0, 0, 1,    6,  47,   25,  -3),
12363           new PlanetaryNutModel(-1, 0, 1, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  23,   13,   0),
12364           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  3, -4, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12365           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-2, 0, 0, 0,    3,  -4,   -2,  -2),
12366           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 2, 0, 0, 0,  -48,-110,  -59,  26),
12367           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 1,   51, 114,   61, -27),
12368 
12369        /* 161-170 */
12370           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 2, -133,   0,    0,  57),
12371           new PlanetaryNutModel( 0, 1,-1, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12372           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  5,  0, 0, 0, 0, 0, 0,  -21,  -6,   -3,  11),
12373           new PlanetaryNutModel( 0, 1,-1, 2, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  -3,   -1,   0),
12374           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  4, 0, 0, 0, 0, 0,  -11, -21,  -11,   6),
12375           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,  -18,-436, -233,   9),
12376           new PlanetaryNutModel( 0,-1, 1, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   35,  -7,    0,   0),
12377           new PlanetaryNutModel( 0, 0, 0, 1, 0,  5, -8,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12378           new PlanetaryNutModel(-2, 0, 2, 1, 0,  6, -8,  0, 0, 0, 0, 0, 0,   11,  -3,   -1,  -6),
12379           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -8, 15, 0, 0, 0, 0, 0,   -5,  -3,   -1,   3),
12380 
12381        /* 171-180 */
12382           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 0, 0, 0, 0,  -53,  -9,   -5,  28),
12383           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  6, -8, 0, 0, 0, 0, 0,    0,   3,    2,   1),
12384           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    4,   0,    0,  -2),
12385           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3,-5, 0, 0, 0,    0,  -4,    0,   0),
12386           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 0, 0, 0, 0,  -50, 194,  103,  27),
12387           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-1, 0, 0, 0, 1,  -13,  52,   28,   7),
12388           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 0,  -91, 248,    0,   0),
12389           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    6,  49,   26,  -3),
12390           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   -6, -47,  -25,   3),
12391           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    0,   5,    3,   0),
12392 
12393        /* 181-190 */
12394           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 2,   52,  23,   10, -23),
12395           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0,-1, 0, 0, 0,   -3,   0,    0,   1),
12396           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0,-1, 0, 0, 0,    0,   5,    3,   0),
12397           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,   -4,   0,    0,   0),
12398           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 13, 0, 0, 0, 0, 2,   -4,   8,    3,   2),
12399           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7,-13, 0, 0, 0, 0, 0,   10,   0,    0,   0),
12400           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -5,  6, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12401           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -8, 11, 0, 0, 0, 0, 0,    0,   8,    4,   0),
12402           new PlanetaryNutModel( 0, 2,-2, 1,-1,  0,  2,  0, 0, 0, 0, 0, 0,    0,   8,    4,   1),
12403           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12404 
12405        /* 191-200 */
12406           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-2, 0, 0, 0,   -4,   0,    0,   0),
12407           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 3, 0, 0, 0,   -8,   4,    2,   4),
12408           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 1,    8,  -4,   -2,  -4),
12409           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 2,    0,  15,    7,   0),
12410           new PlanetaryNutModel(-2, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0, -138,   0,    0,   0),
12411           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12412           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12413           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   54,   0,    0, -29),
12414           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,  10,    4,   0),
12415           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0,  0, -2, 0, 0, 0, 0, 0,   -7,   0,    0,   3),
12416 
12417        /* 201-210 */
12418           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1, -2, 0, 0, 0, 0, 0,  -37,  35,   19,  20),
12419           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12420           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -4,   9,    0,   0),
12421           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 2, 0, 0, 0,    8,   0,    0,  -4),
12422           new PlanetaryNutModel( 0, 1,-1, 1, 0,  3, -6,  0, 0, 0, 0, 0, 0,   -9, -14,   -8,   5),
12423           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 1,   -3,  -9,   -5,   3),
12424           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 0, -145,  47,    0,   0),
12425           new PlanetaryNutModel( 0, 1,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,  -10,  40,   21,   5),
12426           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 1,   11, -49,  -26,  -7),
12427           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,-2150,   0,    0, 932),
12428 
12429        /* 211-220 */
12430           new PlanetaryNutModel( 0, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,  -12,   0,    0,   5),
12431           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,   85,   0,    0, -37),
12432           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12433           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1, -4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12434           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 0,  -86, 153,    0,   0),
12435           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -6,   9,    5,   3),
12436           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    9, -13,   -7,  -5),
12437           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -8,  12,    6,   4),
12438           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 2,  -51,   0,    0,  22),
12439           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,  -11,-268, -116,   5),
12440 
12441        /* 221-230 */
12442           new PlanetaryNutModel( 0, 2,-2, 2, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,  12,    5,   0),
12443           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,    0,   7,    3,   0),
12444           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   31,   6,    3, -17),
12445           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  7,  0, 0, 0, 0, 0, 0,  140,  27,   14, -75),
12446           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   57,  11,    6, -30),
12447           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -8,  0, 0, 0, 0, 0, 0,  -14, -39,    0,   0),
12448           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-1, 0, 0, 0, 0,    0,  -6,   -2,   0),
12449           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-1, 0, 0, 0, 0,    4,  15,    8,  -2),
12450           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    0,   4,    0,   0),
12451           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 1, 0, 0, 0, 0,   -3,   0,    0,   1),
12452 
12453        /* 231-240 */
12454           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 11, 0, 0, 0, 0, 2,    0,  11,    5,   0),
12455           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,-11, 0, 0, 0, 0, 0,    9,   6,    0,   0),
12456           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  4,  0, 0, 0, 0, 0, 2,   -4,  10,    4,   2),
12457           new PlanetaryNutModel( 0, 0, 0, 0, 1,  0, -4,  0, 0, 0, 0, 0, 0,    5,   3,    0,   0),
12458           new PlanetaryNutModel( 2, 0,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,   16,   0,    0,  -9),
12459           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   -3,   0,    0,   0),
12460           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -7,  9, 0, 0, 0, 0, 0,    0,   3,    2,  -1),
12461           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4,-5, 0, 0, 2,    7,   0,    0,  -3),
12462           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 0,  -25,  22,    0,   0),
12463           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,   42, 223,  119, -22),
12464 
12465        /* 241-250 */
12466           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -27,-143,  -77,  14),
12467           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,    9,  49,   26,  -5),
12468           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 2,-1166,   0,    0, 505),
12469           new PlanetaryNutModel( 0, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -5,   0,    0,   2),
12470           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 5, 0, 0, 2,   -6,   0,    0,   3),
12471           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -8,   0,    1,   4),
12472           new PlanetaryNutModel( 0,-1, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12473           new PlanetaryNutModel( 0, 2,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,  117,   0,    0, -63),
12474           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -4, 0, 0, 0, 0, 0,   -4,   8,    4,   2),
12475           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12476 
12477        /* 251-260 */
12478           new PlanetaryNutModel( 0, 1,-1, 2, 0, -5,  7,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   2),
12479           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -6, 0, 0, 0, 0, 0,    0,  31,    0,   0),
12480           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -5,   0,    1,   3),
12481           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -4,  6, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12482           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12483           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 2,  -24, -13,   -6,  10),
12484           new PlanetaryNutModel( 0,-1, 1, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12485           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0, -32,  -17,   0),
12486           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 2,    8,  12,    5,  -3),
12487           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12488 
12489        /* 261-270 */
12490           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -9, 0, 0, 0, 0, 0,    7,  13,    0,   0),
12491           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0,   -3,  16,    0,   0),
12492           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   50,   0,    0, -27),
12493           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -5,   -3,   0),
12494           new PlanetaryNutModel( 0,-2, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12495           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 1,    0,   5,    3,   1),
12496           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 2,   24,   5,    2, -11),
12497           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 2,    5, -11,   -5,  -2),
12498           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 1,   30,  -3,   -2, -16),
12499           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   18,   0,    0,  -9),
12500 
12501        /* 271-280 */
12502           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 0,    8, 614,    0,   0),
12503           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 1,    3,  -3,   -1,  -2),
12504           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    6,  17,    9,  -3),
12505           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 3, 0, 0, 0, 0,   -3,  -9,   -5,   2),
12506           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    0,   6,    3,  -1),
12507           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 2, -127,  21,    9,  55),
12508           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 0, 0, 0, 0, 0,    3,   5,    0,   0),
12509           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8, 0, 0, 0, 0, 2,   -6, -10,   -4,   3),
12510           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    5,   0,    0,   0),
12511           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 2,   16,   9,    4,  -7),
12512 
12513        /* 281-290 */
12514           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12515           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -7, 0, 0, 0, 0, 0,    0,  22,    0,   0),
12516           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12517           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,    7,   0,    0,  -4),
12518           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 10, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12519           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12520           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4, 0, 0, 0, 2,   -9,   3,    1,   4),
12521           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 2,   17,   0,    0,  -7),
12522           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 1,    0,  -3,   -2,  -1),
12523           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -5, 0, 0, 0, 0, 0,  -20,  34,    0,   0),
12524 
12525        /* 291-300 */
12526           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 1,  -10,   0,    1,   5),
12527           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -3,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12528           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 0,   22, -87,    0,   0),
12529           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12530           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 2,   -3,  -6,   -2,   1),
12531           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 2,  -16,  -3,   -1,   7),
12532           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12533           new PlanetaryNutModel( 0,-2, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12534           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -3, 0, 0, 0, 0, 0,  -68,  39,    0,   0),
12535           new PlanetaryNutModel( 0, 2,-2, 1, 0, -4,  4,  0, 0, 0, 0, 0, 0,   27,   0,    0, -14),
12536 
12537        /* 301-310 */
12538           new PlanetaryNutModel( 0,-1, 1, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12539           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -1, 0, 0, 0, 0, 0,  -25,   0,    0,   0),
12540           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 1,  -12,  -3,   -2,   6),
12541           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  6,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12542           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 2,    3,  66,   29,  -1),
12543           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 2,  490,   0,    0,-213),
12544           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,  -22,  93,   49,  12),
12545           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  5,  0, 0, 0, 0, 0, 0,   -7,  28,   15,   4),
12546           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,   -3,  13,    7,   2),
12547           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -6,  0, 0, 0, 0, 0, 0,  -46,  14,    0,   0),
12548 
12549        /* 311-320 */
12550           new PlanetaryNutModel(-2, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12551           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  1, 0, 0, 0, 0, 0,    2,   1,    0,   0),
12552           new PlanetaryNutModel( 0,-1, 1, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12553           new PlanetaryNutModel( 0, 0, 0, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,  -28,   0,    0,  15),
12554           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12555           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -3, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12556           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  3, 0, 0, 0, 0, 2,  -11,   0,    0,   5),
12557           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 12, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12558           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12559           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 1,   25, 106,   57, -13),
12560 
12561        /* 321-330 */
12562           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  0,  0, 0, 0, 0, 0, 0,    5,  21,   11,  -3),
12563           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0, 1485,   0,    0,   0),
12564           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 1,   -7, -32,  -17,   4),
12565           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -2,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12566           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  5, 0, 0, 0, 0, 2,   -6,  -3,   -2,   3),
12567           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 4, 0, 0, 0, 2,   30,  -6,   -2, -13),
12568           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-4, 0, 0, 0, 0,   -4,   4,    0,   0),
12569           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  1,  0, 0, 0, 0, 0, 0,  -19,   0,    0,  10),
12570           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 2,    0,   4,    2,  -1),
12571           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12572 
12573        /* 331-340 */
12574           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -3,  0, 3, 0, 0, 0, 0,    4,   0,    0,  -2),
12575           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  7, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12576           new PlanetaryNutModel(-2, 0, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12577           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  8, 0, 0, 0, 0, 2,    5,   3,    1,  -2),
12578           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 0, 0, 0, 0, 0,    0,  11,    0,   0),
12579           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 2,  118,   0,    0, -52),
12580           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 1,    0,  -5,   -3,   0),
12581           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,  -28,  36,    0,   0),
12582           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -4,  0, 0, 0, 0, 0, 0,    5,  -5,    0,   0),
12583           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 1,   14, -59,  -31,  -8),
12584 
12585        /* 341-350 */
12586           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   9,    5,   1),
12587           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 2, -458,   0,    0, 198),
12588           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 2,    0, -45,  -20,   0),
12589           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 1,    9,   0,    0,  -5),
12590           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -9,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12591           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -4,   -2,  -1),
12592           new PlanetaryNutModel( 0, 2,-2, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   11,   0,    0,  -6),
12593           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  6, 0, 0, 0, 0, 2,    6,   0,    0,  -2),
12594           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -6, 0, 0, 0, 0, 0,  -16,  23,    0,   0),
12595           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,   -2,   0),
12596 
12597        /* 351-360 */
12598           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 2, 0, 0, 0, 2,   -5,   0,    0,   2),
12599           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0, -166, 269,    0,   0),
12600           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   15,   0,    0,  -8),
12601           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  9,  0, 0, 0, 0, 0, 2,   10,   0,    0,  -4),
12602           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -78,  45,    0,   0),
12603           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12604           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 1,    7,   0,    0,  -4),
12605           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,   -5, 328,    0,   0),
12606           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12607           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -2),
12608 
12609        /* 361-370 */
12610           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,   3,    1,   0),
12611           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-3, 0, 0, 0,   -3,   0,    0,   0),
12612           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-5, 0, 0, 0,   -3,   0,    0,   0),
12613           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 1,    0,  -4,   -2,   0),
12614           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,-1223, -26,    0,   0),
12615           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 1,    0,   7,    3,   0),
12616           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 5, 0, 0, 0,    3,   0,    0,   0),
12617           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12618           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -6,  20,    0,   0),
12619           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0, -368,   0,    0,   0),
12620 
12621        /* 371-380 */
12622           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,  -75,   0,    0,   0),
12623           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   11,   0,    0,  -6),
12624           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12625           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 14,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12626           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,  -13, -30,    0,   0),
12627           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 0,   21,   3,    0,   0),
12628           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 2,   -3,   0,    0,   1),
12629           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12630           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    8, -27,    0,   0),
12631           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -8, 3, 0, 0, 0, 0,  -19, -11,    0,   0),
12632 
12633        /* 381-390 */
12634           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  8,-3, 0, 0, 0, 2,   -4,   0,    0,   2),
12635           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 5, 0, 0, 2,    0,   5,    2,   0),
12636           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   2),
12637           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   0),
12638           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-2, 0, 0, 0,   -1,   0,    0,   0),
12639           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 1, 0, 0, 2,  -14,   0,    0,   6),
12640           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12641           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 2,  -74,   0,    0,  32),
12642           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 2, 0, 0, 2,    0,  -3,   -1,   0),
12643           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  5,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12644 
12645        /* 391-400 */
12646           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,    8,  11,    0,   0),
12647           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 1,    0,   3,    2,   0),
12648           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 2, -262,   0,    0, 114),
12649           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12650           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 1,   -7,   0,    0,   4),
12651           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 2,    0, -27,  -12,   0),
12652           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  4, 0, 0, 0, 0, 2,  -19,  -8,   -4,   8),
12653           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 2,  202,   0,    0, -87),
12654           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 1,   -8,  35,   19,   5),
12655           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,   4,    2,   0),
12656 
12657        /* 401-410 */
12658           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   16,  -5,    0,   0),
12659           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    5,   0,    0,  -3),
12660           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,  -3,    0,   0),
12661           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  3,  0, 0, 0, 0, 0, 2,    1,   0,    0,   0),
12662           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2, 0, 0, 0, 2,  -35, -48,  -21,  15),
12663           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  6, 0, 0, 0, 0, 2,   -3,  -5,   -2,   1),
12664           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12665           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6,  9, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12666           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -9, 0, 0, 0, 0, 0,    0,  -5,    0,   0),
12667           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  2,  0, 0, 0, 0, 0, 1,   12,  55,   29,  -6),
12668 
12669        /* 411-420 */
12670           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12671           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0, -598,   0,    0,   0),
12672           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 1,   -3, -13,   -7,   1),
12673           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 3, 0, 0, 0, 2,   -5,  -7,   -3,   2),
12674           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  7, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12675           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -7, 0, 0, 0, 0, 0,    5,  -7,    0,   0),
12676           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12677           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -5, 0, 0, 0, 0, 0,   16,  -6,    0,   0),
12678           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -3,  0, 0, 0, 0, 0, 0,    8,  -3,    0,   0),
12679           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 1,    8, -31,  -16,  -4),
12680 
12681        /* 421-430 */
12682           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12683           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 2,  113,   0,    0, -49),
12684           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 2,    0, -24,  -10,   0),
12685           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12686           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -3, 0, 0, 0, 0, 0,   27,   0,    0,   0),
12687           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  8,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12688           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12689           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 1,    5,   0,    0,  -2),
12690           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12691           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  1, 0, 0, 0, 0, 2,  -13,   0,    0,   6),
12692 
12693        /* 431-440 */
12694           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12695           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  3, 0, 0, 0, 0, 2,  -18, -10,   -4,   8),
12696           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,   -4, -28,    0,   0),
12697           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 2,   -5,   6,    3,   2),
12698           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 13,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12699           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  5, 0, 0, 0, 0, 2,   -5,  -9,   -4,   2),
12700           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 4, 0, 0, 0, 2,   17,   0,    0,  -7),
12701           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-4, 0, 0, 0, 0,   11,   4,    0,   0),
12702           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  7, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12703           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   83,  15,    0,   0),
12704 
12705        /* 441-450 */
12706           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12707           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 2,    0,-114,  -49,   0),
12708           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 2,  117,   0,    0, -51),
12709           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 1,   -5,  19,   10,   2),
12710           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12711           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
12712           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  9, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12713           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12714           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12715           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  393,   3,    0,   0),
12716 
12717        /* 451-460 */
12718           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 1,   -4,  21,   11,   2),
12719           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 2,   -6,   0,   -1,   3),
12720           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5, 10,  0, 0, 0, 0, 0, 2,   -3,   8,    4,   1),
12721           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,    8,   0,    0,   0),
12722           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 2,   18, -29,  -13,  -8),
12723           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  3,  0, 0, 0, 0, 0, 1,    8,  34,   18,  -4),
12724           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   89,   0,    0,   0),
12725           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 1,    3,  12,    6,  -1),
12726           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 2,   54, -15,   -7, -24),
12727           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-3, 0, 0, 0,    0,   3,    0,   0),
12728 
12729        /* 461-470 */
12730           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 13, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12731           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 0,    0,  35,    0,   0),
12732           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 2, -154, -30,  -13,  67),
12733           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   15,   0,    0,   0),
12734           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 1,    0,   4,    2,   0),
12735           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12736           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 2,   80, -71,  -31, -35),
12737           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-1, 0, 0, 2,    0, -20,   -9,   0),
12738           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 15, 0, 0, 0, 0, 2,   11,   5,    2,  -5),
12739           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 15,  0, 0, 0, 0, 0, 2,   61, -96,  -42, -27),
12740 
12741        /* 471-480 */
12742           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  9, -4, 0, 0, 0, 0, 2,   14,   9,    4,  -6),
12743           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2,-5, 0, 0, 2,  -11,  -6,   -3,   5),
12744           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-1,-5, 0, 0, 2,    0,  -3,   -1,   0),
12745           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 3, 0, 0, 0, 2,  123,-415, -180, -53),
12746           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,    0,   0,    0, -35),
12747           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12748           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    7, -32,  -17,  -4),
12749           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -9,   -5,   0),
12750           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    0,  -4,    2,   0),
12751           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 2,  -89,   0,    0,  38),
12752 
12753        /* 481-490 */
12754           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 16,-4,-5, 0, 0, 2,    0, -86,  -19,  -6),
12755           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2,    0,   0,  -19,   6),
12756           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2, -123,-416, -180,  53),
12757           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 1, 5, 0, 0, 2,    0,  -3,   -1,   0),
12758           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 5, 0, 0, 2,   12,  -6,   -3,  -5),
12759           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  4, 0, 0, 0, 0, 2,  -13,   9,    4,   6),
12760           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,    0, -15,   -7,   0),
12761           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12762           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,  -62, -97,  -42,  27),
12763           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, 11,  0, 0, 0, 0, 0, 2,  -11,   5,    2,   5),
12764 
12765        /* 491-500 */
12766           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 1, 0, 0, 2,    0, -19,   -8,   0),
12767           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 2, 0, 0, 0, 2,   -3,   0,    0,   1),
12768           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   4,    2,   0),
12769           new PlanetaryNutModel( 0, 1,-1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12770           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   4,    2,   0),
12771           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  2, 0, 0, 0, 0, 2,  -85, -70,  -31,  37),
12772           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 1, 0, 0, 0, 2,  163, -12,   -5, -72),
12773           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  7,  0, 0, 0, 0, 0, 2,  -63, -16,   -7,  28),
12774           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  4, 0, 0, 0, 0, 2,  -21, -32,  -14,   9),
12775           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12776 
12777        /* 501-510 */
12778           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12779           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   8,    0,   0),
12780           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 2,    3,  10,    4,  -1),
12781           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2, 0, 0, 0, 2,    3,   0,    0,  -1),
12782           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  6, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12783           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -9, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12784           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 0,    6,  19,    0,   0),
12785           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 2,    5,-173,  -75,  -2),
12786           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -7, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12787           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -5, 0, 0, 0, 0, 2,    7, -12,   -5,  -3),
12788 
12789        /* 511-520 */
12790           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 1,   -3,   0,    0,   2),
12791           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 2,    3,  -4,   -2,  -1),
12792           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 2,   74,   0,    0, -32),
12793           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 1,   -3,  12,    6,   2),
12794           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -3, 0, 0, 0, 0, 2,   26, -14,   -6, -11),
12795           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -1, 0, 0, 0, 0, 2,   19,   0,    0,  -8),
12796           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  4,  0, 0, 0, 0, 0, 1,    6,  24,   13,  -3),
12797           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   83,   0,    0,   0),
12798           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 1,    0, -10,   -5,   0),
12799           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 2,   11,  -3,   -1,  -5),
12800 
12801        /* 521-530 */
12802           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  1, 0, 0, 0, 0, 2,    3,   0,    1,  -1),
12803           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  0, 5, 0, 0, 0, 2,    3,   0,    0,  -1),
12804           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12805           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 1,    5, -23,  -12,  -3),
12806           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 2, -339,   0,    0, 147),
12807           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 12,  0, 0, 0, 0, 0, 2,    0, -10,   -5,   0),
12808           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-4, 0, 0, 0, 0,    5,   0,    0,   0),
12809           new PlanetaryNutModel( 0, 2,-2, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12810           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12811           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 0,   18,  -3,    0,   0),
12812 
12813        /* 531-540 */
12814           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 2,    9, -11,   -5,  -4),
12815           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  6,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12816           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  7,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12817           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -7,  0, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12818           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -6, 0, 0, 0, 0, 2,    6,  -9,   -4,  -2),
12819           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 0,   -4, -12,    0,   0),
12820           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 2,   67, -91,  -39, -29),
12821           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -4, 0, 0, 0, 0, 2,   30, -18,   -8, -13),
12822           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 0,    0,   0,    0,   0),
12823           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 2,    0,-114,  -50,   0),
12824 
12825        /* 541-550 */
12826           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,    0,   0,    0,  23),
12827           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,  517,  16,    7,-224),
12828           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-2, 0, 0, 2,    0,  -7,   -3,   0),
12829           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -2, 0, 0, 0, 0, 2,  143,  -3,   -1, -62),
12830           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-1, 0, 0, 2,   29,   0,    0, -13),
12831           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -4,   0,    0,   2),
12832           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 16,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   3),
12833           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 2,-5, 0, 0, 2,    5,  12,    5,  -2),
12834           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 3, 0, 0, 0, 2,  -25,   0,    0,  11),
12835           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 16,-4,-5, 0, 0, 2,   -3,   0,    0,   1),
12836 
12837        /* 551-560 */
12838           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12839           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  8,-3, 0, 0, 0, 2,  -22,  12,    5,  10),
12840           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,   50,   0,    0, -22),
12841           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12842           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12843           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  2, 0, 0, 0, 0, 2,   -4,   4,    2,   2),
12844           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 1, 0, 0, 0, 2,   -5, -11,   -5,   2),
12845           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  8,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12846           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  5,  0, 0, 0, 0, 0, 1,    4,  17,    9,  -2),
12847           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 0,   59,   0,    0,   0),
12848 
12849        /* 561-570 */
12850           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 1,    0,  -4,   -2,   0),
12851           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12852           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12853           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 1,    4, -15,   -8,  -2),
12854           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 2,  370,  -8,    0,-160),
12855           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   0,   -3,   0),
12856           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12857           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -5, 0, 0, 0, 0, 2,   -6,   3,    1,   3),
12858           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -8,  0, 0, 0, 0, 0, 0,    0,   6,    0,   0),
12859           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -3, 0, 0, 0, 0, 2,  -10,   0,    0,   4),
12860 
12861        /* 571-580 */
12862           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -3,  0, 0, 0, 0, 0, 2,    0,   9,    4,   0),
12863           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  2,  0, 0, 0, 0, 0, 2,    4,  17,    7,  -2),
12864           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 2,   34,   0,    0, -15),
12865           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12866           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-4, 0, 0, 0, 2,   -5,   0,    0,   2),
12867           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-3, 0, 0, 0, 2,  -37,  -7,   -3,  16),
12868           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  6,  0, 0, 0, 0, 0, 1,    3,  13,    7,  -2),
12869           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 0,   40,   0,    0,   0),
12870           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12871           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-2, 0, 0, 0, 2, -184,  -3,   -1,  80),
12872 
12873        /* 581-590 */
12874           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -4, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12875           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12876           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 1,    0, -10,   -6,  -1),
12877           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 2,   31,  -6,    0, -13),
12878           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-1, 0, 0, 0, 2,   -3, -32,  -14,   1),
12879           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0,-2, 0, 0, 2,   -7,   0,    0,   3),
12880           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -2, 0, 0, 0, 0, 2,    0,  -8,   -4,   0),
12881           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0, 0, 0, 0, 0,    3,  -4,    0,   0),
12882           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -9,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12883           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -4,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12884 
12885        /* 591-600 */
12886           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 2,   19, -23,  -10,   2),
12887           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   0,    0, -10),
12888           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   3,    2,   0),
12889           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  7,  0, 0, 0, 0, 0, 1,    0,   9,    5,  -1),
12890           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -7,  0, 0, 0, 0, 0, 0,   28,   0,    0,   0),
12891           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 1,    0,  -7,   -4,   0),
12892           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 2,    8,  -4,    0,  -4),
12893           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   0,   -2,   0),
12894           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12895           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-4, 0, 0, 0, 2,   -3,   0,    0,   1),
12896 
12897        /* 601-610 */
12898           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-3, 0, 0, 0, 2,   -9,   0,    1,   4),
12899           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-2, 0, 0, 0, 2,    3,  12,    5,  -1),
12900           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3,  0,  0, 0, 0, 0, 0, 2,   17,  -3,   -1,   0),
12901           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8,  8,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12902           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -8,  0, 0, 0, 0, 0, 0,   19,   0,    0,   0),
12903           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 1,    0,  -5,   -3,   0),
12904           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 2,   14,  -3,    0,  -1),
12905           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,   -1,   0),
12906           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,    0,  -5),
12907           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12908 
12909        /* 611-620 */
12910           new PlanetaryNutModel( 0, 0, 0, 0, 0,  9, -9,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12911           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -4,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12912           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    2,   9,    4,   3),
12913           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    0,   0,    0,  -4),
12914           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    8,   0,    0,   0),
12915           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   4,    2,   0),
12916           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    6,   0,    0,  -3),
12917           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12918           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   3,    1,   0),
12919           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    5,   0,    0,  -2),
12920 
12921        /* 621-630 */
12922           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12923           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
12924           new PlanetaryNutModel( 1, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12925           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    7,   0,    0,   0),
12926           new PlanetaryNutModel( 1, 0,-2, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12927           new PlanetaryNutModel(-1, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12928           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    6,   0,    0,   0),
12929           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
12930           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
12931           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    5,   0,    0,   0),
12932 
12933        /* 631-640 */
12934           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -3,   0,    0,   0),
12935           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
12936           new PlanetaryNutModel(-1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12937           new PlanetaryNutModel(-1, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12938           new PlanetaryNutModel( 1,-1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12939           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   13,   0,    0,   0),
12940           new PlanetaryNutModel(-2, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   21,  11,    0,   0),
12941           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
12942           new PlanetaryNutModel(-1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,  -5,   -2,   0),
12943           new PlanetaryNutModel( 1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12944 
12945        /* 641-650 */
12946           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
12947           new PlanetaryNutModel(-1, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
12948           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   20,  10,    0,   0),
12949           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  -34,   0,    0,   0),
12950           new PlanetaryNutModel(-1, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,  -19,   0,    0,   0),
12951           new PlanetaryNutModel( 1, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,    3,   0,    0,  -2),
12952           new PlanetaryNutModel( 1, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12953           new PlanetaryNutModel( 1, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -6,   0,    0,   3),
12954           new PlanetaryNutModel( 1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12955           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    3,   0,    0,   0),
12956 
12957        /* 651-660 */
12958           new PlanetaryNutModel( 0, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12959           new PlanetaryNutModel( 0, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
12960           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  2,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12961           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    6,   0,    0,  -3),
12962           new PlanetaryNutModel( 0, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   3),
12963           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12964           new PlanetaryNutModel( 0, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
12965           new PlanetaryNutModel( 0, 1, 1, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -3,   -2,   0),
12966           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  126, -63,  -27, -55),
12967           new PlanetaryNutModel(-1, 2, 0, 2, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    1,   2),
12968 
12969        /* 661-670 */
12970           new PlanetaryNutModel( 0, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,   -3,  28,   15,   2),
12971           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    5,   0,    1,  -2),
12972           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   9,    4,   1),
12973           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   9,    4,  -1),
12974           new PlanetaryNutModel(-1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0, -126, -63,  -27,  55),
12975           new PlanetaryNutModel( 2, 2,-2, 2, 0,  0, -2,  0, 3, 0, 0, 0, 0,    3,   0,    0,  -1),
12976           new PlanetaryNutModel( 1, 2, 0, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   21, -11,   -6, -11),
12977           new PlanetaryNutModel( 0, 1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12978           new PlanetaryNutModel(-1, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -21, -11,   -6,  11),
12979           new PlanetaryNutModel(-2, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   1),
12980 
12981        /* 671-680 */
12982           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12983           new PlanetaryNutModel( 0, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    8,   0,    0,  -4),
12984           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -6,   0,    0,   3),
12985           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12986           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    3,   0,    0,  -1),
12987           new PlanetaryNutModel( 1, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12988           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -5,   0,    0,   2),
12989           new PlanetaryNutModel( 2, 2, 0, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   24, -12,   -5, -11),
12990           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   3,    1,   0),
12991           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   3,    1,   0),
12992 
12993        /* 681-687 */
12994           new PlanetaryNutModel( 1, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12995           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -24, -12,   -5,  10),
12996           new PlanetaryNutModel( 2, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    4,   0,   -1,  -2),
12997           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   13,   0,    0,  -6),
12998           new PlanetaryNutModel(-1, 2, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    7,   0,    0,  -3),
12999           new PlanetaryNutModel( 1, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
13000           new PlanetaryNutModel( 0, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,    3,   0,    0,  -1)
13001        };
13002 
13003     /* Number of terms in the planetary nutation model */
13004        final int NPL = xpl.length;
13005 
13006     /*--------------------------------------------------------------------*/
13007 
13008     /* Interval between fundamental date J2000.0 and given date (JC). */
13009        t = ((date1 - DJ00) + date2) / DJC;
13010 
13011     /* ------------------- */
13012     /* LUNI-SOLAR NUTATION */
13013     /* ------------------- */
13014 
13015     /* Fundamental (Delaunay) arguments */
13016 
13017     /* Mean anomaly of the Moon (IERS 2003). */
13018        el = jauFal03(t);
13019 
13020     /* Mean anomaly of the Sun (MHB2000). */
13021        elp = fmod(1287104.79305  +
13022                 t * (129596581.0481  +
13023                 t * (-0.5532  +
13024                 t * (0.000136  +
13025                 t * (-0.00001149)))), TURNAS) * DAS2R;
13026 
13027     /* Mean longitude of the Moon minus that of the ascending node */
13028     /* (IERS 2003. */
13029        f = jauFaf03(t);
13030 
13031     /* Mean elongation of the Moon from the Sun (MHB2000). */
13032        d = fmod(1072260.70369  +
13033               t * (1602961601.2090  +
13034               t * (-6.3706  +
13035               t * (0.006593  +
13036               t * (-0.00003169)))), TURNAS) * DAS2R;
13037 
13038     /* Mean longitude of the ascending node of the Moon (IERS 2003). */
13039        om = jauFaom03(t);
13040 
13041     /* Initialize the nutation values. */
13042        dp = 0.0;
13043        de = 0.0;
13044 
13045     /* Summation of luni-solar nutation series (in reverse order). */
13046        for (i = NLS-1; i >= 0; i--) {
13047 
13048        /* Argument and functions. */
13049           arg = fmod((double)xls[i].nl  * el +
13050                      (double)xls[i].nlp * elp +
13051                      (double)xls[i].nf  * f +
13052                      (double)xls[i].nd  * d +
13053                      (double)xls[i].nom * om, D2PI);
13054           sarg = sin(arg);
13055           carg = cos(arg);
13056 
13057        /* Term. */
13058           dp += (xls[i].sp + xls[i].spt * t) * sarg + xls[i].cp * carg;
13059           de += (xls[i].ce + xls[i].cet * t) * carg + xls[i].se * sarg;
13060        }
13061 
13062     /* Convert from 0.1 microarcsec units to radians. */
13063        dpsils = dp * U2R;
13064        depsls = de * U2R;
13065 
13066     /* ------------------ */
13067     /* PLANETARY NUTATION */
13068     /* ------------------ */
13069 
13070     /* n.b.  The MHB2000 code computes the luni-solar and planetary nutation */
13071     /* in different functions, using slightly different Delaunay */
13072     /* arguments in the two cases.  This behaviour is faithfully */
13073     /* reproduced here.  Use of the IERS 2003 expressions for both */
13074     /* cases leads to negligible changes, well below */
13075     /* 0.1 microarcsecond. */
13076 
13077     /* Mean anomaly of the Moon (MHB2000). */
13078        al = fmod(2.35555598 + 8328.6914269554 * t, D2PI);
13079 
13080     /* Mean longitude of the Moon minus that of the ascending node */
13081     /*(MHB2000). */
13082        af = fmod(1.627905234 + 8433.466158131 * t, D2PI);
13083 
13084     /* Mean elongation of the Moon from the Sun (MHB2000). */
13085        ad = fmod(5.198466741 + 7771.3771468121 * t, D2PI);
13086 
13087     /* Mean longitude of the ascending node of the Moon (MHB2000). */
13088        aom = fmod(2.18243920 - 33.757045 * t, D2PI);
13089 
13090     /* General accumulated precession in longitude (IERS 2003). */
13091        apa = jauFapa03(t);
13092 
13093     /* Planetary longitudes, Mercury through Uranus (IERS 2003). */
13094        alme = jauFame03(t);
13095        alve = jauFave03(t);
13096        alea = jauFae03(t);
13097        alma = jauFama03(t);
13098        alju = jauFaju03(t);
13099        alsa = jauFasa03(t);
13100        alur = jauFaur03(t);
13101 
13102     /* Neptune longitude (MHB2000). */
13103        alne = fmod(5.321159000 + 3.8127774000 * t, D2PI);
13104 
13105     /* Initialize the nutation values. */
13106        dp = 0.0;
13107        de = 0.0;
13108 
13109     /* Summation of planetary nutation series (in reverse order). */
13110        for (i = NPL-1; i >= 0; i--) {
13111 
13112        /* Argument and functions. */
13113           arg = fmod((double)xpl[i].nl  * al   +
13114                      (double)xpl[i].nf  * af   +
13115                      (double)xpl[i].nd  * ad   +
13116                      (double)xpl[i].nom * aom  +
13117                      (double)xpl[i].nme * alme +
13118                      (double)xpl[i].nve * alve +
13119                      (double)xpl[i].nea * alea +
13120                      (double)xpl[i].nma * alma +
13121                      (double)xpl[i].nju * alju +
13122                      (double)xpl[i].nsa * alsa +
13123                      (double)xpl[i].nur * alur +
13124                      (double)xpl[i].nne * alne +
13125                      (double)xpl[i].npa * apa, D2PI);
13126           sarg = sin(arg);
13127           carg = cos(arg);
13128 
13129        /* Term. */
13130           dp += (double)xpl[i].sp * sarg + (double)xpl[i].cp * carg;
13131           de += (double)xpl[i].se * sarg + (double)xpl[i].ce * carg;
13132 
13133        }
13134 
13135     /* Convert from 0.1 microarcsec units to radians. */
13136        dpsipl = dp * U2R;
13137        depspl = de * U2R;
13138 
13139     /* ------- */
13140     /* RESULTS */
13141     /* ------- */
13142 
13143     /* Add luni-solar and planetary components. */
13144        return new NutationTerms( dpsils + dpsipl,
13145                                depsls + depspl);
13146        }
13147     
13148 
13149     /**
13150     *  Nutation, IAU 2000B model.
13151     *
13152     *<p>This function is derived from the International Astronomical Union's
13153     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13154     *
13155     *<p>Status:  canonical model.
13156     *
13157     *<!-- Given: -->
13158     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13159     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13160     *
13161     *<!-- Returned: -->
13162     *     @return  nutation, luni-solar + planetary (Note 2)
13163     *
13164     * <p>Notes:
13165     * <ol>
13166     *
13167     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13168     *     convenient way between the two arguments.  For example,
13169     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13170     *     among others:
13171     *<pre>
13172     *            date1          date2
13173     *
13174     *         2450123.7           0.0       (JD method)
13175     *         2451545.0       -1421.3       (J2000 method)
13176     *         2400000.5       50123.2       (MJD method)
13177     *         2450123.5           0.2       (date &amp; time method)
13178     *</pre>
13179     *     The JD method is the most natural and convenient to use in
13180     *     cases where the loss of several decimal digits of resolution
13181     *     is acceptable.  The J2000 method is best matched to the way
13182     *     the argument is handled internally and will deliver the
13183     *     optimum resolution.  The MJD method and the date &amp; time methods
13184     *     are both good compromises between resolution and convenience.
13185     *
13186     * <li> The nutation components in longitude and obliquity are in radians
13187     *     and with respect to the equinox and ecliptic of date.  The
13188     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
13189     *     value of 84381.448 arcsec.  (The errors that result from using
13190     *     this function with the IAU 2006 value of 84381.406 arcsec can be
13191     *     neglected.)
13192     *
13193     *     The nutation model consists only of luni-solar terms, but
13194     *     includes also a fixed offset which compensates for certain long-
13195     *     period planetary terms (Note 7).
13196     *
13197     * <li> This function is an implementation of the IAU 2000B abridged
13198     *     nutation model formally adopted by the IAU General Assembly in
13199     *     2000.  The function computes the MHB_2000_SHORT luni-solar
13200     *     nutation series (Luzum 2001), but without the associated
13201     *     corrections for the precession rate adjustments and the offset
13202     *     between the GCRS and J2000.0 mean poles.
13203     *
13204     * <li> The full IAU 2000A (MHB2000) nutation model contains nearly 1400
13205     *     terms.  The IAU 2000B model (McCarthy &amp; Luzum 2003) contains only
13206     *     77 terms, plus additional simplifications, yet still delivers
13207     *     results of 1 mas accuracy at present epochs.  This combination of
13208     *     accuracy and size makes the IAU 2000B abridged nutation model
13209     *     suitable for most practical applications.
13210     *
13211     *     The function delivers a pole accurate to 1 mas from 1900 to 2100
13212     *     (usually better than 1 mas, very occasionally just outside
13213     *     1 mas).  The full IAU 2000A model, which is implemented in the
13214     *     function jauNut00a (q.v.), delivers considerably greater accuracy
13215     *     at current dates;  however, to realize this improved accuracy,
13216     *     corrections for the essentially unpredictable free-core-nutation
13217     *     (FCN) must also be included.
13218     *
13219     * <li> The present function provides classical nutation.  The
13220     *     MHB_2000_SHORT algorithm, from which it is adapted, deals also
13221     *     with (i) the offsets between the GCRS and mean poles and (ii) the
13222     *     adjustments in longitude and obliquity due to the changed
13223     *     precession rates.  These additional functions, namely frame bias
13224     *     and precession adjustments, are supported by the JSOFA functions
13225     *     jauBi00  and jauPr00.
13226     *
13227     * <li> The MHB_2000_SHORT algorithm also provides "total" nutations,
13228     *     comprising the arithmetic sum of the frame bias, precession
13229     *     adjustments, and nutation (luni-solar + planetary).  These total
13230     *     nutations can be used in combination with an existing IAU 1976
13231     *     precession implementation, such as jauPmat76,  to deliver GCRS-
13232     *     to-true predictions of mas accuracy at current epochs.  However,
13233     *     for symmetry with the jauNut00a  function (q.v. for the reasons),
13234     *     the JSOFA functions do not generate the "total nutations"
13235     *     directly.  Should they be required, they could of course easily
13236     *     be generated by calling jauBi00, jauPr00 and the present function
13237     *     and adding the results.
13238     *
13239     * <li> The IAU 2000B model includes "planetary bias" terms that are
13240     *     fixed in size but compensate for long-period nutations.  The
13241     *     amplitudes quoted in McCarthy &amp; Luzum (2003), namely
13242     *     Dpsi = -1.5835 mas and Depsilon = +1.6339 mas, are optimized for
13243     *     the "total nutations" method described in Note 6.  The Luzum
13244     *     (2001) values used in this JSOFA implementation, namely -0.135 mas
13245     *     and +0.388 mas, are optimized for the "rigorous" method, where
13246     *     frame bias, precession and nutation are applied separately and in
13247     *     that order.  During the interval 1995-2050, the JSOFA
13248     *     implementation delivers a maximum error of 1.001 mas (not
13249     *     including FCN).
13250     *</ol>
13251     *<p>References:
13252     *
13253     *     <p>Lieske, J.H., Lederle, T., Fricke, W., Morando, B., "Expressions
13254     *     for the precession quantities based upon the IAU /1976/ system of
13255     *     astronomical constants", Astron.Astrophys. 58, 1-2, 1-16. (1977)
13256     *
13257     *     <p>Luzum, B., private communication, 2001 (Fortran code
13258     *     MHB_2000_SHORT)
13259     *
13260     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
13261     *     precession-nutation of the celestial pole", Cel.Mech.Dyn.Astron.
13262     *     85, 37-49 (2003)
13263     *
13264     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13265     *     Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994)
13266     *
13267     *@version 2009 December 17
13268     *
13269     *  @since Release 20101201
13270     *
13271     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13272     */
13273     public static NutationTerms jauNut00b(double date1, double date2)
13274     {
13275        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
13276               dpsils, depsls, dpsipl, depspl;
13277        int i;
13278 
13279     /* Units of 0.1 microarcsecond to radians */
13280        final double U2R = DAS2R / 1e7;
13281 
13282     /* ---------------------------------------- */
13283     /* Fixed offsets in lieu of planetary terms */
13284     /* ---------------------------------------- */
13285 
13286        final double DPPLAN = -0.135 * DMAS2R;
13287        final double DEPLAN =  0.388 * DMAS2R;
13288 
13289     /* --------------------------------------------------- */
13290     /* Luni-solar nutation: argument and term coefficients */
13291     /* --------------------------------------------------- */
13292 
13293     /* The units for the sine and cosine coefficients are */
13294     /* 0.1 microarcsec and the same per Julian century    */
13295 
13296         final class LSNutationModel 
13297         {
13298           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13299           final double ps,pst,pc;     /* longitude sin, t*sin, cos coefficients */
13300           final double ec,ect,es;     /* obliquity cos, t*cos, sin coefficients */
13301           
13302           public LSNutationModel( int nl,int nlp,int nf,int nd,int nom,
13303           double ps, double pst, double pc,    
13304           double ec, double ect, double es    ) {
13305                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13306                this.ps = ps;this.pst = pst;this.pc = pc;    
13307                this.ec = ec;this.ect = ect; this.es= es;    
13308         }
13309 
13310        }
13311         LSNutationModel x[] = {
13312 
13313        /* 1-10 */
13314           new LSNutationModel( 0, 0, 0, 0,1,
13315              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
13316           new LSNutationModel( 0, 0, 2,-2,2,
13317                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
13318           new LSNutationModel( 0, 0, 2, 0,2,-2276413.0,-234.0, 2796.0, 978459.0,-485.0,1374.0),
13319           new LSNutationModel( 0, 0, 0, 0,2,2074554.0,  207.0, -698.0,-897492.0, 470.0,-291.0),
13320           new LSNutationModel( 0, 1, 0, 0,0,1475877.0,-3633.0,11817.0, 73871.0,-184.0,-1924.0),
13321           new LSNutationModel( 0, 1, 2,-2,2,-516821.0, 1226.0, -524.0, 224386.0,-677.0,-174.0),
13322           new LSNutationModel( 1, 0, 0, 0,0, 711159.0,   73.0, -872.0,  -6750.0,   0.0, 358.0),
13323           new LSNutationModel( 0, 0, 2, 0,1,-387298.0, -367.0,  380.0, 200728.0,  18.0, 318.0),
13324           new LSNutationModel( 1, 0, 2, 0,2,-301461.0,  -36.0,  816.0, 129025.0, -63.0, 367.0),
13325           new LSNutationModel( 0,-1, 2,-2,2, 215829.0, -494.0,  111.0, -95929.0, 299.0, 132.0),
13326 
13327        /* 11-20 */
13328           new LSNutationModel( 0, 0, 2,-2,1, 128227.0,  137.0,  181.0, -68982.0,  -9.0,  39.0),
13329           new LSNutationModel(-1, 0, 2, 0,2, 123457.0,   11.0,   19.0, -53311.0,  32.0,  -4.0),
13330           new LSNutationModel(-1, 0, 0, 2,0, 156994.0,   10.0, -168.0,  -1235.0,   0.0,  82.0),
13331           new LSNutationModel( 1, 0, 0, 0,1,  63110.0,   63.0,   27.0, -33228.0,   0.0,  -9.0),
13332           new LSNutationModel(-1, 0, 0, 0,1, -57976.0,  -63.0, -189.0,  31429.0,   0.0, -75.0),
13333           new LSNutationModel(-1, 0, 2, 2,2, -59641.0,  -11.0,  149.0,  25543.0, -11.0,  66.0),
13334           new LSNutationModel( 1, 0, 2, 0,1, -51613.0,  -42.0,  129.0,  26366.0,   0.0,  78.0),
13335           new LSNutationModel(-2, 0, 2, 0,1,  45893.0,   50.0,   31.0, -24236.0, -10.0,  20.0),
13336           new LSNutationModel( 0, 0, 0, 2,0,  63384.0,   11.0, -150.0,  -1220.0,   0.0,  29.0),
13337           new LSNutationModel( 0, 0, 2, 2,2, -38571.0,   -1.0,  158.0,  16452.0, -11.0,  68.0),
13338 
13339        /* 21-30 */
13340           new LSNutationModel( 0,-2, 2,-2,2,  32481.0,    0.0,    0.0, -13870.0,   0.0,   0.0),
13341           new LSNutationModel(-2, 0, 0, 2,0, -47722.0,    0.0,  -18.0,    477.0,   0.0, -25.0),
13342           new LSNutationModel( 2, 0, 2, 0,2, -31046.0,   -1.0,  131.0,  13238.0, -11.0,  59.0),
13343           new LSNutationModel( 1, 0, 2,-2,2,  28593.0,    0.0,   -1.0, -12338.0,  10.0,  -3.0),
13344           new LSNutationModel(-1, 0, 2, 0,1,  20441.0,   21.0,   10.0, -10758.0,   0.0,  -3.0),
13345           new LSNutationModel( 2, 0, 0, 0,0,  29243.0,    0.0,  -74.0,   -609.0,   0.0,  13.0),
13346           new LSNutationModel( 0, 0, 2, 0,0,  25887.0,    0.0,  -66.0,   -550.0,   0.0,  11.0),
13347           new LSNutationModel( 0, 1, 0, 0,1, -14053.0,  -25.0,   79.0,   8551.0,  -2.0, -45.0),
13348           new LSNutationModel(-1, 0, 0, 2,1,  15164.0,   10.0,   11.0,  -8001.0,   0.0,  -1.0),
13349           new LSNutationModel( 0, 2, 2,-2,2, -15794.0,   72.0,  -16.0,   6850.0, -42.0,  -5.0),
13350 
13351        /* 31-40 */
13352           new LSNutationModel( 0, 0,-2, 2,0,  21783.0,    0.0,   13.0,   -167.0,   0.0,  13.0),
13353           new LSNutationModel( 1, 0, 0,-2,1, -12873.0,  -10.0,  -37.0,   6953.0,   0.0, -14.0),
13354           new LSNutationModel( 0,-1, 0, 0,1, -12654.0,   11.0,   63.0,   6415.0,   0.0,  26.0),
13355           new LSNutationModel(-1, 0, 2, 2,1, -10204.0,    0.0,   25.0,   5222.0,   0.0,  15.0),
13356           new LSNutationModel( 0, 2, 0, 0,0,  16707.0,  -85.0,  -10.0,    168.0,  -1.0,  10.0),
13357           new LSNutationModel( 1, 0, 2, 2,2,  -7691.0,    0.0,   44.0,   3268.0,   0.0,  19.0),
13358           new LSNutationModel(-2, 0, 2, 0,0, -11024.0,    0.0,  -14.0,    104.0,   0.0,   2.0),
13359           new LSNutationModel( 0, 1, 2, 0,2,   7566.0,  -21.0,  -11.0,  -3250.0,   0.0,  -5.0),
13360           new LSNutationModel( 0, 0, 2, 2,1,  -6637.0,  -11.0,   25.0,   3353.0,   0.0,  14.0),
13361           new LSNutationModel( 0,-1, 2, 0,2,  -7141.0,   21.0,    8.0,   3070.0,   0.0,   4.0),
13362 
13363        /* 41-50 */
13364           new LSNutationModel( 0, 0, 0, 2,1,  -6302.0,  -11.0,    2.0,   3272.0,   0.0,   4.0),
13365           new LSNutationModel( 1, 0, 2,-2,1,   5800.0,   10.0,    2.0,  -3045.0,   0.0,  -1.0),
13366           new LSNutationModel( 2, 0, 2,-2,2,   6443.0,    0.0,   -7.0,  -2768.0,   0.0,  -4.0),
13367           new LSNutationModel(-2, 0, 0, 2,1,  -5774.0,  -11.0,  -15.0,   3041.0,   0.0,  -5.0),
13368           new LSNutationModel( 2, 0, 2, 0,1,  -5350.0,    0.0,   21.0,   2695.0,   0.0,  12.0),
13369           new LSNutationModel( 0,-1, 2,-2,1,  -4752.0,  -11.0,   -3.0,   2719.0,   0.0,  -3.0),
13370           new LSNutationModel( 0, 0, 0,-2,1,  -4940.0,  -11.0,  -21.0,   2720.0,   0.0,  -9.0),
13371           new LSNutationModel(-1,-1, 0, 2,0,   7350.0,    0.0,   -8.0,    -51.0,   0.0,   4.0),
13372           new LSNutationModel( 2, 0, 0,-2,1,   4065.0,    0.0,    6.0,  -2206.0,   0.0,   1.0),
13373           new LSNutationModel( 1, 0, 0, 2,0,   6579.0,    0.0,  -24.0,   -199.0,   0.0,   2.0),
13374 
13375        /* 51-60 */
13376           new LSNutationModel( 0, 1, 2,-2,1,   3579.0,    0.0,    5.0,  -1900.0,   0.0,   1.0),
13377           new LSNutationModel( 1,-1, 0, 0,0,   4725.0,    0.0,   -6.0,    -41.0,   0.0,   3.0),
13378           new LSNutationModel(-2, 0, 2, 0,2,  -3075.0,    0.0,   -2.0,   1313.0,   0.0,  -1.0),
13379           new LSNutationModel( 3, 0, 2, 0,2,  -2904.0,    0.0,   15.0,   1233.0,   0.0,   7.0),
13380           new LSNutationModel( 0,-1, 0, 2,0,   4348.0,    0.0,  -10.0,    -81.0,   0.0,   2.0),
13381           new LSNutationModel( 1,-1, 2, 0,2,  -2878.0,    0.0,    8.0,   1232.0,   0.0,   4.0),
13382           new LSNutationModel( 0, 0, 0, 1,0,  -4230.0,    0.0,    5.0,    -20.0,   0.0,  -2.0),
13383           new LSNutationModel(-1,-1, 2, 2,2,  -2819.0,    0.0,    7.0,   1207.0,   0.0,   3.0),
13384           new LSNutationModel(-1, 0, 2, 0,0,  -4056.0,    0.0,    5.0,     40.0,   0.0,  -2.0),
13385           new LSNutationModel( 0,-1, 2, 2,2,  -2647.0,    0.0,   11.0,   1129.0,   0.0,   5.0),
13386 
13387        /* 61-70 */
13388           new LSNutationModel(-2, 0, 0, 0,1,  -2294.0,    0.0,  -10.0,   1266.0,   0.0,  -4.0),
13389           new LSNutationModel( 1, 1, 2, 0,2,   2481.0,    0.0,   -7.0,  -1062.0,   0.0,  -3.0),
13390           new LSNutationModel( 2, 0, 0, 0,1,   2179.0,    0.0,   -2.0,  -1129.0,   0.0,  -2.0),
13391           new LSNutationModel(-1, 1, 0, 1,0,   3276.0,    0.0,    1.0,     -9.0,   0.0,   0.0),
13392           new LSNutationModel( 1, 1, 0, 0,0,  -3389.0,    0.0,    5.0,     35.0,   0.0,  -2.0),
13393           new LSNutationModel( 1, 0, 2, 0,0,   3339.0,    0.0,  -13.0,   -107.0,   0.0,   1.0),
13394           new LSNutationModel(-1, 0, 2,-2,1,  -1987.0,    0.0,   -6.0,   1073.0,   0.0,  -2.0),
13395           new LSNutationModel( 1, 0, 0, 0,2,  -1981.0,    0.0,    0.0,    854.0,   0.0,   0.0),
13396           new LSNutationModel(-1, 0, 0, 1,0,   4026.0,    0.0, -353.0,   -553.0,   0.0,-139.0),
13397           new LSNutationModel( 0, 0, 2, 1,2,   1660.0,    0.0,   -5.0,   -710.0,   0.0,  -2.0),
13398 
13399        /* 71-77 */
13400           new LSNutationModel(-1, 0, 2, 4,2,  -1521.0,    0.0,    9.0,    647.0,   0.0,   4.0),
13401           new LSNutationModel(-1, 1, 0, 1,1,   1314.0,    0.0,    0.0,   -700.0,   0.0,   0.0),
13402           new LSNutationModel( 0,-2, 2,-2,1,  -1283.0,    0.0,    0.0,    672.0,   0.0,   0.0),
13403           new LSNutationModel( 1, 0, 2, 2,1,  -1331.0,    0.0,    8.0,    663.0,   0.0,   4.0),
13404           new LSNutationModel(-2, 0, 2, 2,2,   1383.0,    0.0,   -2.0,   -594.0,   0.0,  -2.0),
13405           new LSNutationModel(-1, 0, 0, 0,2,   1405.0,    0.0,    4.0,   -610.0,   0.0,   2.0),
13406           new LSNutationModel( 1, 1, 2,-2,2,   1290.0,    0.0,    0.0,   -556.0,   0.0,   0.0)
13407        };
13408 
13409     /* Number of terms in the series */
13410        final int NLS = x.length;
13411 
13412     /*--------------------------------------------------------------------*/
13413 
13414     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13415        t = ((date1 - DJ00) + date2) / DJC;
13416 
13417     /* --------------------*/
13418     /* LUNI-SOLAR NUTATION */
13419     /* --------------------*/
13420 
13421     /* Fundamental (Delaunay) arguments from Simon et al. (1994) */
13422 
13423     /* Mean anomaly of the Moon. */
13424        el = fmod(485868.249036 + (1717915923.2178) * t, TURNAS) * DAS2R;
13425 
13426     /* Mean anomaly of the Sun. */
13427        elp = fmod(1287104.79305 + (129596581.0481) * t, TURNAS) * DAS2R;
13428 
13429     /* Mean argument of the latitude of the Moon. */
13430        f = fmod(335779.526232 + (1739527262.8478) * t, TURNAS) * DAS2R;
13431 
13432     /* Mean elongation of the Moon from the Sun. */
13433        d = fmod(1072260.70369 + (1602961601.2090) * t, TURNAS) * DAS2R;
13434 
13435     /* Mean longitude of the ascending node of the Moon. */
13436        om = fmod(450160.398036 + (-6962890.5431) * t, TURNAS) * DAS2R;
13437 
13438     /* Initialize the nutation values. */
13439        dp = 0.0;
13440        de = 0.0;
13441 
13442     /* Summation of luni-solar nutation series (smallest terms first). */
13443        for (i = NLS-1; i >= 0; i--) {
13444 
13445        /* Argument and functions. */
13446           arg = fmod( (double)x[i].nl  * el  +
13447                       (double)x[i].nlp * elp +
13448                       (double)x[i].nf  * f   +
13449                       (double)x[i].nd  * d   +
13450                       (double)x[i].nom * om, D2PI  );
13451           sarg = sin(arg);
13452           carg = cos(arg);
13453 
13454        /* Term. */
13455           dp += (x[i].ps + x[i].pst * t) * sarg + x[i].pc * carg;
13456           de += (x[i].ec + x[i].ect * t) * carg + x[i].es * sarg;
13457        }
13458 
13459     /* Convert from 0.1 microarcsec units to radians. */
13460        dpsils = dp * U2R;
13461        depsls = de * U2R;
13462 
13463     /* ------------------------------*/
13464     /* IN LIEU OF PLANETARY NUTATION */
13465     /* ------------------------------*/
13466 
13467     /* Fixed offset to correct for missing terms in truncated series. */
13468        dpsipl = DPPLAN;
13469        depspl = DEPLAN;
13470 
13471     /* --------*/
13472     /* RESULTS */
13473     /* --------*/
13474 
13475     /* Add luni-solar and planetary components. */
13476        return new NutationTerms(   dpsils + dpsipl,
13477                                 depsls + depspl);
13478 
13479     }
13480     
13481 
13482     /**
13483     *  IAU 2000A nutation with adjustments to match the IAU 2006
13484     *  precession.
13485     *
13486     *<!-- Given: -->
13487     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13488     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13489     *
13490     *<!-- Returned: -->
13491     *     @return  nutation, luni-solar + planetary (Note 2)
13492     *
13493     *<p>Status:  canonical model.
13494     *
13495     * <p>Notes:
13496     * <ol>
13497     *
13498     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13499     *     convenient way between the two arguments.  For example,
13500     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13501     *     among others:
13502     *<pre>
13503     *            date1          date2
13504     *
13505     *         2450123.7           0.0       (JD method)
13506     *         2451545.0       -1421.3       (J2000 method)
13507     *         2400000.5       50123.2       (MJD method)
13508     *         2450123.5           0.2       (date &amp; time method)
13509     *</pre>
13510     *     The JD method is the most natural and convenient to use in
13511     *     cases where the loss of several decimal digits of resolution
13512     *     is acceptable.  The J2000 method is best matched to the way
13513     *     the argument is handled internally and will deliver the
13514     *     optimum resolution.  The MJD method and the date &amp; time methods
13515     *     are both good compromises between resolution and convenience.
13516     *
13517     * <li> The nutation components in longitude and obliquity are in radians
13518     *     and with respect to the mean equinox and ecliptic of date,
13519     *     IAU 2006 precession model (Hilton et al. 2006, Capitaine et al.
13520     *     2005).
13521     *
13522     * <li> The function first computes the IAU 2000A nutation, then applies
13523     *     adjustments for (i) the consequences of the change in obliquity
13524     *     from the IAU 1980 ecliptic to the IAU 2006 ecliptic and (ii) the
13525     *     secular variation in the Earth's dynamical flattening.
13526     *
13527     * <li> The present function provides classical nutation, complementing
13528     *     the IAU 2000 frame bias and IAU 2006 precession.  It delivers a
13529     *     pole which is at current epochs accurate to a few tens of
13530     *     microarcseconds, apart from the free core nutation.
13531     *</ol>
13532     *<p>Called:<ul>
13533     *     <li>{@link #jauNut00a} nutation, IAU 2000A
13534     * </ul>
13535     *<p>References:
13536     *
13537     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
13538     *     Astron.Astrophys. 387, 700
13539     *
13540     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
13541     *     Astron.Astrophys. 58, 1-16
13542     *
13543     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
13544     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
13545     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
13546     *
13547     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13548     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
13549     *
13550     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
13551     *     Astron.Astrophys.Supp.Ser. 135, 111
13552     *
13553     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
13554     *     Resolutions", in IERS Workshop 5.1 (2002)
13555     *
13556     *@version 2008 May 24
13557     *
13558     *  @since Release 20101201
13559     *
13560     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13561     */
13562     public static NutationTerms jauNut06a(double date1, double date2)
13563     {
13564        double t, fj2;
13565 
13566 
13567     /* Interval between fundamental date J2000.0 and given date (JC). */
13568        t = ((date1 - DJ00) + date2) / DJC;
13569 
13570     /* Factor correcting for secular variation of J2. */
13571        fj2 = -2.7774e-6 * t;
13572 
13573     /* Obtain IAU 2000A nutation. */
13574        NutationTerms nt = jauNut00a(date1, date2);
13575        
13576     /* Apply P03 adjustments (Wallace &amp; Capitaine, 2006, Eqs.5). */
13577        return new NutationTerms( nt.dpsi + nt.dpsi * (0.4697e-6 + fj2),
13578                                  nt.deps + nt.deps * fj2);
13579 
13580      }
13581     
13582     /**
13583     *  Nutation, IAU 1980 model.
13584     *
13585     *<p>This function is derived from the International Astronomical Union's
13586     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13587     *
13588     *<p>Status:  canonical model.
13589     *
13590     *<!-- Given: -->
13591     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13592     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13593     *
13594     *<!-- Returned: -->
13595     *     @return dpsi           double      <u>returned</u> nutation in longitude (radians)
13596     *             deps           double      <u>returned</u> nutation in obliquity (radians)
13597     *
13598     * <p>Notes:
13599     * <ol>
13600     *
13601     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13602     *     convenient way between the two arguments.  For example,
13603     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13604     *     among others:
13605     *<pre>
13606     *            date1          date2
13607     *
13608     *         2450123.7           0.0       (JD method)
13609     *         2451545.0       -1421.3       (J2000 method)
13610     *         2400000.5       50123.2       (MJD method)
13611     *         2450123.5           0.2       (date &amp; time method)
13612     *</pre>
13613     *     The JD method is the most natural and convenient to use in
13614     *     cases where the loss of several decimal digits of resolution
13615     *     is acceptable.  The J2000 method is best matched to the way
13616     *     the argument is handled internally and will deliver the
13617     *     optimum resolution.  The MJD method and the date &amp; time methods
13618     *     are both good compromises between resolution and convenience.
13619     *
13620     * <li> The nutation components are with respect to the ecliptic of
13621     *     date.
13622     *</ol>
13623     *<p>Called:<ul>
13624     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
13625     * </ul>
13626     *<p>Reference:
13627     *
13628     *     <p>Explanatory Supplement to the Astronomical Almanac,
13629     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
13630     *     Section 3.222 (p111).
13631     *
13632     *@version 2008 September 30
13633     *
13634     *  @since Release 20101201
13635     *
13636     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13637     */
13638     public static NutationTerms jauNut80(double date1, double date2)
13639     {
13640        double t, el, elp, f, d, om, dp, de, arg, s, c;
13641        int j;
13642 
13643     /* Units of 0.1 milliarcsecond to radians */
13644        final double U2R = DAS2R / 1e4;
13645 
13646     /* ------------------------------------------------ */
13647     /* Table of multiples of arguments and coefficients */
13648     /* ------------------------------------------------ */
13649 
13650     /* The units for the sine and cosine coefficients are 0.1 mas and */
13651     /* the same per Julian century */
13652 
13653        final class NutationModel {
13654           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13655           final double sp,spt;        /* longitude sine, 1 and t coefficients */
13656           final double ce,cet;        /* obliquity cosine, 1 and t coefficients */
13657           
13658           public NutationModel(int nl,int nlp,int nf,int nd,int nom,
13659           double sp,double spt,       
13660           double ce,double cet       ) {
13661                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13662                this.sp = sp;this.spt = spt;      
13663                this.ce = ce;this.cet = cet;     
13664         }
13665        }
13666        NutationModel x[] = {
13667 
13668        /* 1-10 */
13669           new NutationModel(  0,  0,  0,  0,  1, -171996.0, -174.2,  92025.0,    8.9 ),
13670           new NutationModel(  0,  0,  0,  0,  2,    2062.0,    0.2,   -895.0,    0.5 ),
13671           new NutationModel( -2,  0,  2,  0,  1,      46.0,    0.0,    -24.0,    0.0 ),
13672           new NutationModel(  2,  0, -2,  0,  0,      11.0,    0.0,      0.0,    0.0 ),
13673           new NutationModel( -2,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13674           new NutationModel(  1, -1,  0, -1,  0,      -3.0,    0.0,      0.0,    0.0 ),
13675           new NutationModel(  0, -2,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13676           new NutationModel(  2,  0, -2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13677           new NutationModel(  0,  0,  2, -2,  2,  -13187.0,   -1.6,   5736.0,   -3.1 ),
13678           new NutationModel(  0,  1,  0,  0,  0,    1426.0,   -3.4,     54.0,   -0.1 ),
13679 
13680        /* 11-20 */
13681           new NutationModel(  0,  1,  2, -2,  2,    -517.0,    1.2,    224.0,   -0.6 ),
13682           new NutationModel(  0, -1,  2, -2,  2,     217.0,   -0.5,    -95.0,    0.3 ),
13683           new NutationModel(  0,  0,  2, -2,  1,     129.0,    0.1,    -70.0,    0.0 ),
13684           new NutationModel(  2,  0,  0, -2,  0,      48.0,    0.0,      1.0,    0.0 ),
13685           new NutationModel(  0,  0,  2, -2,  0,     -22.0,    0.0,      0.0,    0.0 ),
13686           new NutationModel(  0,  2,  0,  0,  0,      17.0,   -0.1,      0.0,    0.0 ),
13687           new NutationModel(  0,  1,  0,  0,  1,     -15.0,    0.0,      9.0,    0.0 ),
13688           new NutationModel(  0,  2,  2, -2,  2,     -16.0,    0.1,      7.0,    0.0 ),
13689           new NutationModel(  0, -1,  0,  0,  1,     -12.0,    0.0,      6.0,    0.0 ),
13690           new NutationModel( -2,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13691 
13692        /* 21-30 */
13693           new NutationModel(  0, -1,  2, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13694           new NutationModel(  2,  0,  0, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13695           new NutationModel(  0,  1,  2, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13696           new NutationModel(  1,  0,  0, -1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13697           new NutationModel(  2,  1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13698           new NutationModel(  0,  0, -2,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13699           new NutationModel(  0,  1, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13700           new NutationModel(  0,  1,  0,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13701           new NutationModel( -1,  0,  0,  1,  1,       1.0,    0.0,      0.0,    0.0 ),
13702           new NutationModel(  0,  1,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13703 
13704        /* 31-40 */
13705           new NutationModel(  0,  0,  2,  0,  2,   -2274.0,   -0.2,    977.0,   -0.5 ),
13706           new NutationModel(  1,  0,  0,  0,  0,     712.0,    0.1,     -7.0,    0.0 ),
13707           new NutationModel(  0,  0,  2,  0,  1,    -386.0,   -0.4,    200.0,    0.0 ),
13708           new NutationModel(  1,  0,  2,  0,  2,    -301.0,    0.0,    129.0,   -0.1 ),
13709           new NutationModel(  1,  0,  0, -2,  0,    -158.0,    0.0,     -1.0,    0.0 ),
13710           new NutationModel( -1,  0,  2,  0,  2,     123.0,    0.0,    -53.0,    0.0 ),
13711           new NutationModel(  0,  0,  0,  2,  0,      63.0,    0.0,     -2.0,    0.0 ),
13712           new NutationModel(  1,  0,  0,  0,  1,      63.0,    0.1,    -33.0,    0.0 ),
13713           new NutationModel( -1,  0,  0,  0,  1,     -58.0,   -0.1,     32.0,    0.0 ),
13714           new NutationModel( -1,  0,  2,  2,  2,     -59.0,    0.0,     26.0,    0.0 ),
13715 
13716        /* 41-50 */
13717           new NutationModel(  1,  0,  2,  0,  1,     -51.0,    0.0,     27.0,    0.0 ),
13718           new NutationModel(  0,  0,  2,  2,  2,     -38.0,    0.0,     16.0,    0.0 ),
13719           new NutationModel(  2,  0,  0,  0,  0,      29.0,    0.0,     -1.0,    0.0 ),
13720           new NutationModel(  1,  0,  2, -2,  2,      29.0,    0.0,    -12.0,    0.0 ),
13721           new NutationModel(  2,  0,  2,  0,  2,     -31.0,    0.0,     13.0,    0.0 ),
13722           new NutationModel(  0,  0,  2,  0,  0,      26.0,    0.0,     -1.0,    0.0 ),
13723           new NutationModel( -1,  0,  2,  0,  1,      21.0,    0.0,    -10.0,    0.0 ),
13724           new NutationModel( -1,  0,  0,  2,  1,      16.0,    0.0,     -8.0,    0.0 ),
13725           new NutationModel(  1,  0,  0, -2,  1,     -13.0,    0.0,      7.0,    0.0 ),
13726           new NutationModel( -1,  0,  2,  2,  1,     -10.0,    0.0,      5.0,    0.0 ),
13727 
13728        /* 51-60 */
13729           new NutationModel(  1,  1,  0, -2,  0,      -7.0,    0.0,      0.0,    0.0 ),
13730           new NutationModel(  0,  1,  2,  0,  2,       7.0,    0.0,     -3.0,    0.0 ),
13731           new NutationModel(  0, -1,  2,  0,  2,      -7.0,    0.0,      3.0,    0.0 ),
13732           new NutationModel(  1,  0,  2,  2,  2,      -8.0,    0.0,      3.0,    0.0 ),
13733           new NutationModel(  1,  0,  0,  2,  0,       6.0,    0.0,      0.0,    0.0 ),
13734           new NutationModel(  2,  0,  2, -2,  2,       6.0,    0.0,     -3.0,    0.0 ),
13735           new NutationModel(  0,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13736           new NutationModel(  0,  0,  2,  2,  1,      -7.0,    0.0,      3.0,    0.0 ),
13737           new NutationModel(  1,  0,  2, -2,  1,       6.0,    0.0,     -3.0,    0.0 ),
13738           new NutationModel(  0,  0,  0, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13739 
13740        /* 61-70 */
13741           new NutationModel(  1, -1,  0,  0,  0,       5.0,    0.0,      0.0,    0.0 ),
13742           new NutationModel(  2,  0,  2,  0,  1,      -5.0,    0.0,      3.0,    0.0 ),
13743           new NutationModel(  0,  1,  0, -2,  0,      -4.0,    0.0,      0.0,    0.0 ),
13744           new NutationModel(  1,  0, -2,  0,  0,       4.0,    0.0,      0.0,    0.0 ),
13745           new NutationModel(  0,  0,  0,  1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13746           new NutationModel(  1,  1,  0,  0,  0,      -3.0,    0.0,      0.0,    0.0 ),
13747           new NutationModel(  1,  0,  2,  0,  0,       3.0,    0.0,      0.0,    0.0 ),
13748           new NutationModel(  1, -1,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13749           new NutationModel( -1, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13750           new NutationModel( -2,  0,  0,  0,  1,      -2.0,    0.0,      1.0,    0.0 ),
13751 
13752        /* 71-80 */
13753           new NutationModel(  3,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13754           new NutationModel(  0, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13755           new NutationModel(  1,  1,  2,  0,  2,       2.0,    0.0,     -1.0,    0.0 ),
13756           new NutationModel( -1,  0,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13757           new NutationModel(  2,  0,  0,  0,  1,       2.0,    0.0,     -1.0,    0.0 ),
13758           new NutationModel(  1,  0,  0,  0,  2,      -2.0,    0.0,      1.0,    0.0 ),
13759           new NutationModel(  3,  0,  0,  0,  0,       2.0,    0.0,      0.0,    0.0 ),
13760           new NutationModel(  0,  0,  2,  1,  2,       2.0,    0.0,     -1.0,    0.0 ),
13761           new NutationModel( -1,  0,  0,  0,  2,       1.0,    0.0,     -1.0,    0.0 ),
13762           new NutationModel(  1,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13763 
13764        /* 81-90 */
13765           new NutationModel( -2,  0,  2,  2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13766           new NutationModel( -1,  0,  2,  4,  2,      -2.0,    0.0,      1.0,    0.0 ),
13767           new NutationModel(  2,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13768           new NutationModel(  1,  1,  2, -2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13769           new NutationModel(  1,  0,  2,  2,  1,      -1.0,    0.0,      1.0,    0.0 ),
13770           new NutationModel( -2,  0,  2,  4,  2,      -1.0,    0.0,      1.0,    0.0 ),
13771           new NutationModel( -1,  0,  4,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13772           new NutationModel(  1, -1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13773           new NutationModel(  2,  0,  2, -2,  1,       1.0,    0.0,     -1.0,    0.0 ),
13774           new NutationModel(  2,  0,  2,  2,  2,      -1.0,    0.0,      0.0,    0.0 ),
13775 
13776        /* 91-100 */
13777           new NutationModel(  1,  0,  0,  2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13778           new NutationModel(  0,  0,  4, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13779           new NutationModel(  3,  0,  2, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13780           new NutationModel(  1,  0,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13781           new NutationModel(  0,  1,  2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13782           new NutationModel( -1, -1,  0,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13783           new NutationModel(  0,  0, -2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13784           new NutationModel(  0,  0,  2, -1,  2,      -1.0,    0.0,      0.0,    0.0 ),
13785           new NutationModel(  0,  1,  0,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13786           new NutationModel(  1,  0, -2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13787 
13788        /* 101-106 */
13789           new NutationModel(  0, -1,  2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13790           new NutationModel(  1,  1,  0, -2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13791           new NutationModel(  1,  0, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13792           new NutationModel(  2,  0,  0,  2,  0,       1.0,    0.0,      0.0,    0.0 ),
13793           new NutationModel(  0,  0,  2,  4,  2,      -1.0,    0.0,      0.0,    0.0 ),
13794           new NutationModel(  0,  1,  0,  1,  0,       1.0,    0.0,      0.0,    0.0 )
13795        };
13796 
13797     /* Number of terms in the series */
13798        final int NT = x.length;
13799 
13800     /*--------------------------------------------------------------------*/
13801 
13802     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13803        t = ((date1 - DJ00) + date2) / DJC;
13804 
13805     /* --------------------- */
13806     /* Fundamental arguments */
13807     /* --------------------- */
13808 
13809     /* Mean longitude of Moon minus mean longitude of Moon's perigee. */
13810        el = jauAnpm(
13811             (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t)
13812             * DAS2R + fmod(1325.0 * t, 1.0) * D2PI);
13813 
13814     /* Mean longitude of Sun minus mean longitude of Sun's perigee. */
13815        elp = jauAnpm(
13816              (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t)
13817              * DAS2R + fmod(99.0 * t, 1.0) * D2PI);
13818 
13819     /* Mean longitude of Moon minus mean longitude of Moon's node. */
13820        f = jauAnpm(
13821            (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t)
13822            * DAS2R + fmod(1342.0 * t, 1.0) * D2PI);
13823 
13824     /* Mean elongation of Moon from Sun. */
13825        d = jauAnpm(
13826            (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t)
13827            * DAS2R + fmod(1236.0 * t, 1.0) * D2PI);
13828 
13829     /* Longitude of the mean ascending node of the lunar orbit on the */
13830     /* ecliptic, measured from the mean equinox of date. */
13831        om = jauAnpm(
13832             (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t)
13833             * DAS2R + fmod(-5.0 * t, 1.0) * D2PI);
13834 
13835     /* --------------- */
13836     /* Nutation series */
13837     /* --------------- */
13838 
13839     /* Initialize nutation components. */
13840        dp = 0.0;
13841        de = 0.0;
13842 
13843     /* Sum the nutation terms, ending with the biggest. */
13844        for (j = NT-1; j >= 0; j--) {
13845 
13846        /* Form argument for current term. */
13847           arg = (double)x[j].nl  * el
13848               + (double)x[j].nlp * elp
13849               + (double)x[j].nf  * f
13850               + (double)x[j].nd  * d
13851               + (double)x[j].nom * om;
13852 
13853        /* Accumulate current nutation term. */
13854           s = x[j].sp + x[j].spt * t;
13855           c = x[j].ce + x[j].cet * t;
13856           if (s != 0.0) dp += s * sin(arg);
13857           if (c != 0.0) de += c * cos(arg);
13858        }
13859 
13860     /* Convert results from 0.1 mas units to radians. */
13861        return new NutationTerms( dp * U2R,
13862                                  de * U2R);
13863 
13864         }
13865     
13866 
13867     /**
13868     *  Form the matrix of nutation for a given date, IAU 1980 model.
13869     *
13870     *<p>This function is derived from the International Astronomical Union's
13871     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13872     *
13873     *<p>Status:  support function.
13874     *
13875     *<!-- Given: -->
13876     *     @param date1 double           TDB date (Note 1)
13877     *     @param date2 double           TDB date (Note 1) 
13878     *
13879     *<!-- Returned: -->
13880     *     @return           double[3][3]       nutation matrix
13881     *
13882     * <p>Notes:
13883     * <ol>
13884     *
13885     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13886     *     convenient way between the two arguments.  For example,
13887     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13888     *     among others:
13889     *<pre>
13890     *            date1          date2
13891     *
13892     *         2450123.7           0.0       (JD method)
13893     *         2451545.0       -1421.3       (J2000 method)
13894     *         2400000.5       50123.2       (MJD method)
13895     *         2450123.5           0.2       (date &amp; time method)
13896     *</pre>
13897     *     The JD method is the most natural and convenient to use in
13898     *     cases where the loss of several decimal digits of resolution
13899     *     is acceptable.  The J2000 method is best matched to the way
13900     *     the argument is handled internally and will deliver the
13901     *     optimum resolution.  The MJD method and the date &amp; time methods
13902     *     are both good compromises between resolution and convenience.
13903     *
13904     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
13905     *     where the p-vector V(true) is with respect to the true
13906     *     equatorial triad of date and the p-vector V(mean) is with
13907     *     respect to the mean equatorial triad of date.
13908     *</ol>
13909     *<p>Called:<ul>
13910     *     <li>{@link #jauNut80} nutation, IAU 1980
13911     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
13912     *     <li>{@link #jauNumat} form nutation matrix
13913     * </ul>
13914     *@version 2008 May 12
13915     *
13916     *  @since Release 20101201
13917     *
13918     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13919     */
13920     public static double[][] jauNutm80(double date1, double date2)
13921     {
13922         double rmatn[][];
13923     /* Nutation components and mean obliquity. */
13924        NutationTerms nt = jauNut80(date1, date2);
13925        double epsa = jauObl80(date1, date2);
13926 
13927     /* Build the rotation matrix. */
13928        rmatn = jauNumat(epsa, nt.dpsi, nt.deps);
13929 
13930        return rmatn;
13931 
13932         }
13933     
13934 
13935     /**
13936     *  Mean obliquity of the ecliptic, IAU 2006 precession model.
13937     *
13938     *<p>This function is derived from the International Astronomical Union's
13939     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13940     *
13941     *<p>Status:  canonical model.
13942     *
13943     *<!-- Given: -->
13944     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13945     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13946     *
13947     * <!-- Returned (function value): -->
13948     *  @return double   obliquity of the ecliptic (radians, Note 2)
13949     *
13950     * <p>Notes:
13951     * <ol>
13952     *
13953     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13954     *     convenient way between the two arguments.  For example,
13955     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13956     *     among others:
13957     *<pre>
13958     *            date1          date2
13959     *
13960     *         2450123.7           0.0       (JD method)
13961     *         2451545.0       -1421.3       (J2000 method)
13962     *         2400000.5       50123.2       (MJD method)
13963     *         2450123.5           0.2       (date &amp; time method)
13964     *</pre>
13965     *     The JD method is the most natural and convenient to use in
13966     *     cases where the loss of several decimal digits of resolution
13967     *     is acceptable.  The J2000 method is best matched to the way
13968     *     the argument is handled internally and will deliver the
13969     *     optimum resolution.  The MJD method and the date &amp; time methods
13970     *     are both good compromises between resolution and convenience.
13971     *
13972     * <li> The result is the angle between the ecliptic and mean equator of
13973     *     date date1+date2.
13974     *</ol>
13975     *<p>Reference:
13976     *
13977     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
13978     *
13979     *@version 2009 March 16
13980     *
13981     *  @since Release 20101201
13982     *
13983     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13984     */
13985     public static double jauObl06(double date1, double date2)
13986     {
13987        double t, eps0;
13988 
13989 
13990     /* Interval between fundamental date J2000.0 and given date (JC). */
13991        t = ((date1 - DJ00) + date2) / DJC;
13992 
13993     /* Mean obliquity. */
13994        eps0 = (84381.406     +
13995               (-46.836769    +
13996               ( -0.0001831   +
13997               (  0.00200340  +
13998               ( -0.000000576 +
13999               ( -0.0000000434) * t) * t) * t) * t) * t) * DAS2R;
14000 
14001        return eps0;
14002 
14003         }
14004     
14005 
14006     /**
14007     *  Mean obliquity of the ecliptic, IAU 1980 model.
14008     *
14009     *<p>This function is derived from the International Astronomical Union's
14010     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14011     *
14012     *<p>Status:  canonical model.
14013     *
14014     *<!-- Given: -->
14015     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14016     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14017     *
14018     * <!-- Returned (function value): -->
14019     *  @return double    obliquity of the ecliptic (radians, Note 2)
14020     *
14021     * <p>Notes:
14022     * <ol>
14023     *
14024     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14025     *     convenient way between the two arguments.  For example,
14026     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14027     *     among others:
14028     *<pre>
14029     *            date1          date2
14030     *
14031     *         2450123.7           0.0       (JD method)
14032     *         2451545.0       -1421.3       (J2000 method)
14033     *         2400000.5       50123.2       (MJD method)
14034     *         2450123.5           0.2       (date &amp; time method)
14035     *</pre>
14036     *     The JD method is the most natural and convenient to use in
14037     *     cases where the loss of several decimal digits of resolution
14038     *     is acceptable.  The J2000 method is best matched to the way
14039     *     the argument is handled internally and will deliver the
14040     *     optimum resolution.  The MJD method and the date &amp; time methods
14041     *     are both good compromises between resolution and convenience.
14042     *
14043     * <li> The result is the angle between the ecliptic and mean equator of
14044     *     date date1+date2.
14045     *</ol>
14046     *<p>Reference:
14047     *
14048     *     <p>Explanatory Supplement to the Astronomical Almanac,
14049     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
14050     *     Expression 3.222-1 (p114).
14051     *
14052     *@version 2009 March 16
14053     *
14054     *  @since Release 20101201
14055     *
14056     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14057     */
14058     public static double jauObl80(double date1, double date2)
14059     {
14060        double t, eps0;
14061 
14062 
14063     /* Interval between fundamental epoch J2000.0 and given date (JC). */
14064        t = ((date1 - DJ00) + date2) / DJC;
14065 
14066     /* Mean obliquity of date. */
14067        eps0 = DAS2R * (84381.448  +
14068                       (-46.8150   +
14069                       (-0.00059   +
14070                       ( 0.001813) * t) * t) * t);
14071 
14072        return eps0;
14073 
14074         }
14075     
14076     
14077     /**
14078      * equinox based precession angles.
14079      *  .
14080      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14081      * @version $Revision$ $date$
14082      */
14083     public static class PrecessionAngles {
14084         /** epsilon_0   obliquity at J2000.0. */
14085         public double eps0; 
14086         /** psi_A       luni-solar precession. */
14087         public double psia;
14088         /** omega_A     inclination of equator wrt J2000.0 ecliptic. */
14089         public  double oma;
14090         /** P_A         ecliptic pole x, J2000.0 ecliptic triad. */
14091         public  double bpa;
14092         /** Q_A         ecliptic pole -y, J2000.0 ecliptic triad. */
14093         public double bqa;
14094         /** pi_A        angle between moving and J2000.0 ecliptics. */
14095         public  double pia;
14096         /** Pi_A        longitude of ascending node of the ecliptic. */
14097         public  double bpia;
14098         /** epsilon_A   obliquity of the ecliptic. */
14099         public double epsa;
14100         /** chi_A       planetary precession. */
14101         public  double chia;
14102         /** z_A         equatorial precession: -3rd 323 Euler angle. */
14103         public  double za;
14104         /** zeta_A      equatorial precession: -1st 323 Euler angle. */
14105         public  double zetaa;
14106         /** theta_A     equatorial precession: 2nd 323 Euler angle. */
14107         public double thetaa;
14108         /** p_A         general precession. */
14109         public  double pa;
14110         /** gamma_J2000 J2000.0 RA difference of ecliptic poles. */
14111         public  double gam;
14112         /** phi_J2000   J2000.0 codeclination of ecliptic pole. */
14113         public  double phi;
14114         /** psi_J2000   longitude difference of equator poles, J2000.0. */
14115         public  double psi;
14116 
14117         public PrecessionAngles ( double eps0, double psia, double oma, double bpa,
14118                  double bqa, double pia, double bpia,
14119                  double epsa, double chia, double za, double zetaa,
14120                  double thetaa, double pa,
14121                  double gam, double phi, double psi){
14122             
14123             this.eps0 = eps0;
14124             this.psia = psia;
14125             this.oma = oma;
14126             this.bpa = bpa;
14127             this.bqa = bqa;
14128             this.pia = pia;
14129             this.bpia = bpia;
14130             this.epsa = epsa;
14131             this.chia = chia;
14132             this.za = za;
14133             this.zetaa = zetaa;
14134             this.thetaa = thetaa;
14135             this.pa = pa;
14136             this.gam = gam;
14137             this.phi = phi;
14138             this.psi = psi;
14139         }
14140     }
14141     /**
14142     *  Precession angles, IAU 2006, equinox based.
14143     *
14144     *<p>This function is derived from the International Astronomical Union's
14145     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14146     *
14147     *<p>Status:  canonical models.
14148     *
14149     *<!-- Given: -->
14150     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14151     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14152     *
14153     *  @return (see Note 2):
14154     *     eps0          double   epsilon_0
14155     *     psia          double   psi_A
14156     *     oma           double   omega_A
14157     *     bpa           double   P_A
14158     *     bqa           double   Q_A
14159     *     pia           double   pi_A
14160     *     bpia          double   Pi_A
14161     *     epsa          double   obliquity epsilon_A
14162     *     chia          double   chi_A
14163     *     za            double   z_A
14164     *     zetaa         double   zeta_A
14165     *     thetaa        double   theta_A
14166     *     pa            double   p_A
14167     *     gam           double   F-W angle gamma_J2000
14168     *     phi           double   F-W angle phi_J2000
14169     *     psi           double   F-W angle psi_J2000
14170     *
14171     * <p>Notes:
14172     * <ol>
14173     *
14174     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14175     *     convenient way between the two arguments.  For example,
14176     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14177     *     among others:
14178     *<pre>
14179     *            date1          date2
14180     *
14181     *         2450123.7           0.0       (JD method)
14182     *         2451545.0       -1421.3       (J2000 method)
14183     *         2400000.5       50123.2       (MJD method)
14184     *         2450123.5           0.2       (date &amp; time method)
14185     *</pre>
14186     *     The JD method is the most natural and convenient to use in
14187     *     cases where the loss of several decimal digits of resolution
14188     *     is acceptable.  The J2000 method is best matched to the way
14189     *     the argument is handled internally and will deliver the
14190     *     optimum resolution.  The MJD method and the date &amp; time methods
14191     *     are both good compromises between resolution and convenience.
14192     *
14193     * <li> This function returns the set of equinox based angles for the
14194     *     Capitaine et al. "P03" precession theory, adopted by the IAU in
14195     *     2006.  The angles are set out in Table 1 of Hilton et al. (2006):
14196     *
14197     *     eps0   epsilon_0   obliquity at J2000.0
14198     *     psia   psi_A       luni-solar precession
14199     *     oma    omega_A     inclination of equator wrt J2000.0 ecliptic
14200     *     bpa    P_A         ecliptic pole x, J2000.0 ecliptic triad
14201     *     bqa    Q_A         ecliptic pole -y, J2000.0 ecliptic triad
14202     *     pia    pi_A        angle between moving and J2000.0 ecliptics
14203     *     bpia   Pi_A        longitude of ascending node of the ecliptic
14204     *     epsa   epsilon_A   obliquity of the ecliptic
14205     *     chia   chi_A       planetary precession
14206     *     za     z_A         equatorial precession: -3rd 323 Euler angle
14207     *     zetaa  zeta_A      equatorial precession: -1st 323 Euler angle
14208     *     thetaa theta_A     equatorial precession: 2nd 323 Euler angle
14209     *     pa     p_A         general precession
14210     *     gam    gamma_J2000 J2000.0 RA difference of ecliptic poles
14211     *     phi    phi_J2000   J2000.0 codeclination of ecliptic pole
14212     *     psi    psi_J2000   longitude difference of equator poles, J2000.0
14213     *
14214     *     The returned values are all radians.
14215     *
14216     * <li> Hilton et al. (2006) Table 1 also contains angles that depend on
14217     *     models distinct from the P03 precession theory itself, namely the
14218     *     IAU 2000A frame bias and nutation.  The quoted polynomials are
14219     *     used in other JSOFA functions:
14220     *
14221     *     . jauXy06  contains the polynomial parts of the X and Y series.
14222     *
14223     *     . jauS06  contains the polynomial part of the s+XY/2 series.
14224     *
14225     *     . jauPfw06  implements the series for the Fukushima-Williams
14226     *       angles that are with respect to the GCRS pole (i.e. the variants
14227     *       that include frame bias).
14228     *
14229     * <li> The IAU resolution stipulated that the choice of parameterization
14230     *     was left to the user, and so an IAU compliant precession
14231     *     implementation can be constructed using various combinations of
14232     *     the angles returned by the present function.
14233     *
14234     * <li> The parameterization used by JSOFA is the Fukushima-Williams angles
14235     *     referred directly to the GCRS pole.  These are the final four
14236     *     arguments returned by the present function, but are more
14237     *     efficiently calculated by calling the function jauPfw06.   JSOFA
14238     *     also supports the direct computation of the CIP GCRS X,Y by
14239     *     series, available by calling jauXy06.
14240     *
14241     * <li> The agreement between the different parameterizations is at the
14242     *     1 microarcsecond level in the present era.
14243     *
14244     * <li> When constructing a precession formulation that refers to the GCRS
14245     *     pole rather than the dynamical pole, it may (depending on the
14246     *     choice of angles) be necessary to introduce the frame bias
14247     *     explicitly.
14248     *
14249     * <li> It is permissible to re-use the same variable in the returned
14250     *     arguments.  The quantities are stored in the stated order.
14251     *</ol>
14252     *<p>Reference:
14253     *
14254     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14255     *
14256     *<p>Called:<ul>
14257     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14258     * </ul>
14259     *@version 2009 December 17
14260     *
14261     *  @since Release 20101201
14262     *
14263     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14264     */
14265     public static PrecessionAngles jauP06e(double date1, double date2)
14266     {
14267        double t;
14268        double eps0,  psia,  oma,  bpa,
14269         bqa,  pia,  bpia,
14270         epsa,  chia,  za,  zetaa,
14271         thetaa,  pa,
14272         gam,  phi,  psi;
14273 
14274     /* Interval between fundamental date J2000.0 and given date (JC). */
14275        t = ((date1 - DJ00) + date2) / DJC;
14276 
14277     /* Obliquity at J2000.0. */
14278 
14279        eps0 = 84381.406 * DAS2R;
14280 
14281     /* Luni-solar precession. */
14282 
14283        psia = ( 5038.481507     +
14284                (   -1.0790069    +
14285                (   -0.00114045   +
14286                (    0.000132851  +
14287                (   -0.0000000951 )
14288                * t) * t) * t) * t) * t * DAS2R;
14289 
14290     /* Inclination of mean equator with respect to the J2000.0 ecliptic. */
14291 
14292        oma = eps0 + ( -0.025754     +
14293                       (  0.0512623    +
14294                       ( -0.00772503   +
14295                       ( -0.000000467  +
14296                       (  0.0000003337 )
14297                       * t) * t) * t) * t) * t * DAS2R;
14298 
14299     /* Ecliptic pole x, J2000.0 ecliptic triad. */
14300 
14301        bpa = (  4.199094     +
14302               (  0.1939873    +
14303               ( -0.00022466   +
14304               ( -0.000000912  +
14305               (  0.0000000120 )
14306               * t) * t) * t) * t) * t * DAS2R;
14307 
14308     /* Ecliptic pole -y, J2000.0 ecliptic triad. */
14309 
14310        bqa = ( -46.811015     +
14311               (   0.0510283    +
14312               (   0.00052413   +
14313               (  -0.000000646  +
14314               (  -0.0000000172 )
14315               * t) * t) * t) * t) * t * DAS2R;
14316 
14317     /* Angle between moving and J2000.0 ecliptics. */
14318 
14319        pia = ( 46.998973     +
14320               ( -0.0334926    +
14321               ( -0.00012559   +
14322               (  0.000000113  +
14323               ( -0.0000000022 )
14324               * t) * t) * t) * t) * t * DAS2R;
14325 
14326     /* Longitude of ascending node of the moving ecliptic. */
14327 
14328        bpia = ( 629546.7936      +
14329                (   -867.95758     +
14330                (      0.157992    +
14331                (     -0.0005371   +
14332                (     -0.00004797  +
14333                (      0.000000072 )
14334                * t) * t) * t) * t) * t) * DAS2R;
14335 
14336     /* Mean obliquity of the ecliptic. */
14337 
14338        epsa = jauObl06(date1, date2);
14339 
14340     /* Planetary precession. */
14341 
14342        chia = ( 10.556403     +
14343                ( -2.3814292    +
14344                ( -0.00121197   +
14345                (  0.000170663  +
14346                ( -0.0000000560 )
14347                * t) * t) * t) * t) * t * DAS2R;
14348 
14349     /* Equatorial precession: minus the third of the 323 Euler angles. */
14350 
14351        za = (   -2.650545     +
14352              ( 2306.077181     +
14353              (    1.0927348    +
14354              (    0.01826837   +
14355              (   -0.000028596  +
14356              (   -0.0000002904 )
14357              * t) * t) * t) * t) * t) * DAS2R;
14358 
14359     /* Equatorial precession: minus the first of the 323 Euler angles. */
14360 
14361        zetaa = (    2.650545     +
14362                 ( 2306.083227     +
14363                 (    0.2988499    +
14364                 (    0.01801828   +
14365                 (   -0.000005971  +
14366                 (   -0.0000003173 )
14367                 * t) * t) * t) * t) * t) * DAS2R;
14368 
14369     /* Equatorial precession: second of the 323 Euler angles. */
14370 
14371        thetaa = ( 2004.191903     +
14372                  (   -0.4294934    +
14373                  (   -0.04182264   +
14374                  (   -0.000007089  +
14375                  (   -0.0000001274 )
14376                  * t) * t) * t) * t) * t * DAS2R;
14377 
14378     /* General precession. */
14379 
14380        pa = ( 5028.796195     +
14381              (    1.1054348    +
14382              (    0.00007964   +
14383              (   -0.000023857  +
14384              (    0.0000000383 )
14385              * t) * t) * t) * t) * t * DAS2R;
14386 
14387     /* Fukushima-Williams angles for precession. */
14388 
14389        gam = ( 10.556403     +
14390               (  0.4932044    +
14391               ( -0.00031238   +
14392               ( -0.000002788  +
14393               (  0.0000000260 )
14394               * t) * t) * t) * t) * t * DAS2R;
14395 
14396        phi = eps0 + ( -46.811015     +
14397                       (   0.0511269    +
14398                       (   0.00053289   +
14399                       (  -0.000000440  +
14400                       (  -0.0000000176 )
14401                       * t) * t) * t) * t) * t * DAS2R;
14402 
14403        psi = ( 5038.481507     +
14404               (    1.5584176    +
14405               (   -0.00018522   +
14406               (   -0.000026452  +
14407               (   -0.0000000148 )
14408               * t) * t) * t) * t) * t * DAS2R;
14409 
14410        return new PrecessionAngles(eps0, psia, oma, bpa, bqa, pia, bpia, epsa, chia, za, zetaa, thetaa, pa, gam, phi, psi);
14411 
14412         }
14413     
14414 
14415     /**
14416     *  Extend a p-vector to a pv-vector by appending a zero velocity.
14417     *
14418     *<p>This function is derived from the International Astronomical Union's
14419     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14420     *
14421     *<p>Status:  vector/matrix support function.
14422     *
14423     *<!-- Given: -->
14424     *     @param p         double[3]        p-vector
14425     *
14426     *<!-- Returned: -->
14427     *     @return pv        double[2][3]      <u>returned</u> pv-vector
14428     *
14429     *<p>Called:<ul>
14430     *     <li>{@link #jauCp} copy p-vector
14431     *     <li>{@link #jauZp} zero p-vector
14432     * </ul>
14433     *@version 2008 May 11
14434     *
14435     *  @since Release 20101201
14436     *
14437     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14438     */
14439     public static double[][] jauP2pv(double p[] )
14440     {
14441         double pv[][] = new double[3][3];
14442         jauCp(p, pv[0]);
14443         jauZp(pv[1]);
14444 
14445         return pv;
14446 
14447         }
14448     
14449     /**
14450      * A position expressed in spherical polar coordinates.
14451      *  .
14452      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14453      * @version $Revision$ $date$
14454      */
14455     public static class SphericalPosition {
14456         /** longitude angle (radians) */
14457         public double theta;
14458         /** latitude angle (radians) */
14459         public double phi;
14460         /** radial distance */
14461         public double r;
14462         public SphericalPosition(double theta, double phi, double r) {
14463            this.theta = theta;
14464            this.phi = phi;
14465            this.r = r;
14466         }
14467     }
14468     
14469     /**
14470     *  P-vector to spherical polar coordinates.
14471     *
14472     *<p>This function is derived from the International Astronomical Union's
14473     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14474     *
14475     *<p>Status:  vector/matrix support function.
14476     *
14477     *<!-- Given: -->
14478     *     @param p         double[3]     p-vector
14479     *
14480     *<!-- Returned: -->
14481     *     @return theta     double         <u>returned</u> longitude angle (radians)
14482     *             phi       double         <u>returned</u> latitude angle (radians)
14483     *             r         double         <u>returned</u> radial distance
14484     *
14485     * <p>Notes:
14486     * <ol>
14487     *
14488     * <li> If P is null, zero theta, phi and r are returned.
14489     *
14490     * <li> At either pole, zero theta is returned.
14491     *</ol>
14492     *<p>Called:<ul>
14493     *     <li>{@link #jauC2s} p-vector to spherical
14494     *     <li>{@link #jauPm} modulus of p-vector
14495     * </ul>
14496     *@version 2008 May 22
14497     *
14498     *  @since Release 20101201
14499     *
14500     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14501     */
14502     public static SphericalPosition jauP2s(double p[])
14503     {
14504        SphericalCoordinate sc = jauC2s(p);
14505        double r = jauPm(p);
14506 
14507        return new SphericalPosition(sc.alpha, sc.delta, r);
14508 
14509         }
14510     
14511 
14512     /**
14513     *  Position-angle from two p-vectors.
14514     *
14515     *<p>This function is derived from the International Astronomical Union's
14516     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14517     *
14518     *<p>Status:  vector/matrix support function.
14519     *
14520     *<!-- Given: -->
14521     *     @param a       double[3]   direction of reference point
14522     *     @param b       double[3]   direction of point whose PA is required
14523     *
14524     * <!-- Returned (function value): -->
14525     *  @return double     position angle of b with respect to a (radians)
14526     *
14527     * <p>Notes:
14528     * <ol>
14529     *
14530     * <li> The result is the position angle, in radians, of direction b with
14531     *     respect to direction a.  It is in the range -pi to +pi.  The
14532     *     sense is such that if b is a small distance "north" of a the
14533     *     position angle is approximately zero, and if b is a small
14534     *     distance "east" of a the position angle is approximately +pi/2.
14535     *
14536     * <li> The vectors a and b need not be of unit length.
14537     *
14538     * <li> Zero is returned if the two directions are the same or if either
14539     *     vector is null.
14540     *
14541     * <li> If vector a is at a pole, the result is ill-defined.
14542     *</ol>
14543     *<p>Called:<ul>
14544     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
14545     *     <li>{@link #jauPm} modulus of p-vector
14546     *     <li>{@link #jauPxp} vector product of two p-vectors
14547     *     <li>{@link #jauPmp} p-vector minus p-vector
14548     *     <li>{@link #jauPdp} scalar product of two p-vectors
14549     * </ul>
14550     *@version 2008 May 25
14551     *
14552     *  @since Release 20101201
14553     *
14554     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14555     */
14556     public static double jauPap(double a[] , double b[] )
14557     {
14558        double am, au[] = new double[3], bm, st, ct, xa, ya, za, eta[] = new double[3], xi[] = new double[3], a2b[] = new double[3], pa;
14559 
14560 
14561     /* Modulus and direction of the a vector. */
14562        NormalizedVector nv = jauPn(a );
14563        am = nv.r; au = nv.u;
14564     /* Modulus of the b vector. */
14565        bm = jauPm(b);
14566 
14567     /* Deal with the case of a null vector. */
14568        if ((am == 0.0) || (bm == 0.0)) {
14569           st = 0.0;
14570           ct = 1.0;
14571        } else {
14572 
14573        /* The "north" axis tangential from a (arbitrary length). */
14574           xa = a[0];
14575           ya = a[1];
14576           za = a[2];
14577           eta[0] = -xa * za;
14578           eta[1] = -ya * za;
14579           eta[2] =  xa*xa + ya*ya;
14580 
14581        /* The "east" axis tangential from a (same length). */
14582           xi = jauPxp(eta,au);
14583 
14584        /* The vector from a to b. */
14585           a2b = jauPmp(b, a);
14586 
14587        /* Resolve into components along the north and east axes. */
14588           st = jauPdp(a2b, xi);
14589           ct = jauPdp(a2b, eta);
14590 
14591        /* Deal with degenerate cases. */
14592           if ((st == 0.0) && (ct == 0.0)) ct = 1.0;
14593        }
14594 
14595     /* Position angle. */
14596        pa = atan2(st, ct);
14597 
14598        return pa;
14599 
14600         }
14601     
14602 
14603     /**
14604     *  Position-angle from spherical coordinates.
14605     *
14606     *<p>This function is derived from the International Astronomical Union's
14607     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14608     *
14609     *<p>Status:  vector/matrix support function.
14610     *
14611     *<!-- Given: -->
14612     *     @param al      double      longitude of point A (e.g. RA) in radians
14613     *     @param ap      double      latitude of point A (e.g. Dec) in radians
14614     *     @param bl      double      longitude of point B
14615     *     @param bp      double      latitude of point B
14616     *
14617     * <!-- Returned (function value): -->
14618     *  @return double     position angle of B with respect to A
14619     *
14620     * <p>Notes:
14621     * <ol>
14622     *
14623     * <li> The result is the bearing (position angle), in radians, of point
14624     *     B with respect to point A.  It is in the range -pi to +pi.  The
14625     *     sense is such that if B is a small distance "east" of point A,
14626     *     the bearing is approximately +pi/2.
14627     *
14628     * <li> Zero is returned if the two points are coincident.
14629     *</ol>
14630     *@version 2008 May 22
14631     *
14632     *  @since Release 20101201
14633     *
14634     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14635     */
14636     public static double jauPas(double al, double ap, double bl, double bp)
14637     {
14638        double dl, x, y, pa;
14639 
14640 
14641        dl = bl - al;
14642        y = sin(dl) * cos(bp);
14643        x = sin(bp) * cos(ap) - cos(bp) * sin(ap) * cos(dl);
14644        pa = ((x != 0.0) || (y != 0.0)) ? atan2(y, x) : 0.0;
14645 
14646        return pa;
14647 
14648         }
14649     
14650 
14651     /**
14652     *  This function forms three Euler angles which implement general
14653     *  precession from epoch J2000.0, using the IAU 2006 model.  Frame
14654     *  bias (the offset between ICRS and mean J2000.0) is included.
14655     *
14656     *<p>This function is derived from the International Astronomical Union's
14657     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14658     *
14659     *<p>Status:  support function.
14660     *
14661     *<!-- Given: -->
14662     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14663     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14664     *
14665     *<!-- Returned: -->
14666     *     @return bzeta          1st rotation: radians cw around z,
14667     *                            3rd rotation: radians cw around z,
14668     *                            2nd rotation: radians ccw around y.
14669     *
14670     * <p>Notes:
14671     * <ol>
14672     *
14673     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14674     *     convenient way between the two arguments.  For example,
14675     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14676     *     among others:
14677     *<pre>
14678     *            date1          date2
14679     *
14680     *         2450123.7           0.0       (JD method)
14681     *         2451545.0       -1421.3       (J2000 method)
14682     *         2400000.5       50123.2       (MJD method)
14683     *         2450123.5           0.2       (date &amp; time method)
14684     *</pre>
14685     *     The JD method is the most natural and convenient to use in
14686     *     cases where the loss of several decimal digits of resolution
14687     *     is acceptable.  The J2000 method is best matched to the way
14688     *     the argument is handled internally and will deliver the
14689     *     optimum resolution.  The MJD method and the date &amp; time methods
14690     *     are both good compromises between resolution and convenience.
14691     *
14692     * <li> The traditional accumulated precession angles zeta_A, z_A,
14693     *     theta_A cannot be obtained in the usual way, namely through
14694     *     polynomial expressions, because of the frame bias.  The latter
14695     *     means that two of the angles undergo rapid changes near this
14696     *     date.  They are instead the results of decomposing the
14697     *     precession-bias matrix obtained by using the Fukushima-Williams
14698     *     method, which does not suffer from the problem.  The
14699     *     decomposition returns values which can be used in the
14700     *     conventional formulation and which include frame bias.
14701     *
14702     * <li> The three angles are returned in the conventional order, which
14703     *     is not the same as the order of the corresponding Euler
14704     *     rotations.  The precession-bias matrix is
14705     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
14706     *
14707     * <li> Should zeta_A, z_A, theta_A angles be required that do not
14708     *     contain frame bias, they are available by calling the JSOFA
14709     *     function jauP06e.
14710     *</ol>
14711     *<p>Called:<ul>
14712     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
14713     *     <li>{@link #jauRz} rotate around Z-axis
14714     * </ul>
14715     *@version 2008 May 26
14716     *
14717     *  @since Release 20101201
14718     *
14719     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14720     */
14721     public static EulerAngles jauPb06(double date1, double date2)
14722     {
14723        double r[][] = new double[3][3], r31, r32;
14724 
14725 
14726     /* Precession matrix via Fukushima-Williams angles. */
14727        r = jauPmat06(date1, date2);
14728 
14729     /* Solve for z. */
14730        double bz = atan2(r[1][2], r[0][2]);
14731 
14732     /* Remove it from the matrix. */
14733        jauRz(bz, r);
14734 
14735     /* Solve for the remaining two angles. */
14736        double bzeta = atan2 (r[1][0], r[1][1]);
14737        r31 = r[2][0];
14738        r32 = r[2][1];
14739        double btheta = atan2(-dsign(sqrt(r31 * r31 + r32 * r32), r[0][2]),
14740                        r[2][2]);
14741 
14742        return new EulerAngles(bzeta, bz, btheta);
14743 
14744         }
14745     
14746 
14747     /**
14748     *  p-vector inner (=scalar=dot) product.
14749     *
14750     *<p>This function is derived from the International Astronomical Union's
14751     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14752     *
14753     *<p>Status:  vector/matrix support function.
14754     *
14755     *<!-- Given: -->
14756     *     @param a       double[3]      first p-vector
14757     *     @param b       double[3]      second p-vector
14758     *
14759     * <!-- Returned (function value): -->
14760     *  @return double        a . b
14761     *
14762     *@version 2008 May 22
14763     *
14764     *  @since Release 20101201
14765     *
14766     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14767     */
14768     public static double jauPdp(double a[] , double b[] )
14769     {
14770        double w;
14771 
14772 
14773        w  = a[0] * b[0]
14774           + a[1] * b[1]
14775           + a[2] * b[2];
14776 
14777        return w;
14778 
14779         }
14780     
14781 
14782     /**
14783      * Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14784      * 
14785      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
14786      * 
14787      * @since AIDA Stage 1
14788      */
14789     public static class FWPrecessionAngles{
14790         /** F-W angle gamma_bar (radians) */
14791         public double gamb;
14792         /** F-W angle phi_bar (radians) */
14793         public double phib;
14794         /** F-W angle psi_bar (radians) */
14795         public double psib;
14796         /** F-W angle epsilon_A (radians) */
14797         public double epsa;
14798         public FWPrecessionAngles(double gamb, double phib, double psib, double epsa) {
14799             this.gamb = gamb;
14800             this.phib = phib;
14801             this.psib = psib;
14802             this.epsa = epsa;
14803         }
14804     }
14805     /**
14806     *  Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14807     *
14808     *<p>This function is derived from the International Astronomical Union's
14809     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14810     *
14811     *<p>Status:  canonical model.
14812     *
14813     *<!-- Given: -->
14814     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14815     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14816     *
14817     *<!-- Returned: -->
14818     *     @return gamb          double     <u>returned</u> F-W angle gamma_bar (radians)
14819     *             phib          double     <u>returned</u> F-W angle phi_bar (radians)
14820     *             psib          double     <u>returned</u> F-W angle psi_bar (radians)
14821     *             epsa          double     <u>returned</u> F-W angle epsilon_A (radians)
14822     *
14823     * <p>Notes:
14824     * <ol>
14825     *
14826     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14827     *     convenient way between the two arguments.  For example,
14828     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14829     *     among others:
14830     *<pre>
14831     *            date1          date2
14832     *
14833     *         2450123.7           0.0       (JD method)
14834     *         2451545.0       -1421.3       (J2000 method)
14835     *         2400000.5       50123.2       (MJD method)
14836     *         2450123.5           0.2       (date &amp; time method)
14837     *</pre>
14838     *     The JD method is the most natural and convenient to use in
14839     *     cases where the loss of several decimal digits of resolution
14840     *     is acceptable.  The J2000 method is best matched to the way
14841     *     the argument is handled internally and will deliver the
14842     *     optimum resolution.  The MJD method and the date &amp; time methods
14843     *     are both good compromises between resolution and convenience.
14844     *
14845     * <li> Naming the following points:
14846     *
14847     *           e = J2000.0 ecliptic pole,
14848     *           p = GCRS pole,
14849     *           E = mean ecliptic pole of date,
14850     *     and   P = mean pole of date,
14851     *
14852     *     the four Fukushima-Williams angles are as follows:
14853     *
14854     *        gamb = gamma_bar = epE
14855     *        phib = phi_bar = pE
14856     *        psib = psi_bar = pEP
14857     *        epsa = epsilon_A = EP
14858     *
14859     * <li> The matrix representing the combined effects of frame bias and
14860     *     precession is:
14861     *
14862     *        PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb)
14863     *
14864     * <li> The matrix representing the combined effects of frame bias,
14865     *     precession and nutation is simply:
14866     *
14867     *        NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb)
14868     *
14869     *     where dP and dE are the nutation components with respect to the
14870     *     ecliptic of date.
14871     *</ol>
14872     *<p>Reference:
14873     *
14874     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14875     *
14876     *<p>Called:<ul>
14877     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14878     * </ul>
14879     *@version 2009 December 17
14880     *
14881     *  @since Release 20101201
14882     *
14883     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14884     */
14885     public static FWPrecessionAngles jauPfw06(double date1, double date2 )
14886     {
14887        double t;
14888 
14889 
14890     /* Interval between fundamental date J2000.0 and given date (JC). */
14891        t = ((date1 - DJ00) + date2) / DJC;
14892 
14893     /* P03 bias+precession angles. */
14894        double gamb = (    -0.052928     +
14895                (    10.556378     +
14896                (     0.4932044    +
14897                (    -0.00031238   +
14898                (    -0.000002788  +
14899                (     0.0000000260 )
14900                * t) * t) * t) * t) * t) * DAS2R;
14901        double phib = ( 84381.412819     +
14902                (   -46.811016     +
14903                (     0.0511268    +
14904                (     0.00053289   +
14905                (    -0.000000440  +
14906                (    -0.0000000176 )
14907                * t) * t) * t) * t) * t) * DAS2R;
14908        double psib = (    -0.041775     +
14909                (  5038.481484     +
14910                (     1.5584175    +
14911                (    -0.00018522   +
14912                (    -0.000026452  +
14913                (    -0.0000000148 )
14914                * t) * t) * t) * t) * t) * DAS2R;
14915        double epsa =  jauObl06(date1, date2);
14916 
14917        return new FWPrecessionAngles(gamb, phib, psib, epsa);
14918 
14919         }
14920     
14921 
14922     /**
14923     *<p>This function is derived from the International Astronomical Union's
14924     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14925     *
14926     *<p>Status:  support function.
14927     *
14928     *  Approximate heliocentric position and velocity of a nominated major
14929     *  planet:  Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or
14930     *  Neptune (but not the Earth itself).
14931     *
14932     *<!-- Given: -->
14933     *     @param date1   double        TDB date part A (Note 1)
14934     *     @param date2   double        TDB date part B (Note 1)
14935     *     @param np      int           planet (1=Mercury, 2=Venus, 3=EMB, 4=Mars,
14936     *                                  5=Jupiter,  6=Saturn,  7=Uranus, 8=Neptune)
14937     *
14938     *  Returned (argument):
14939     *     @param  pv     double[2][3] (returned) planet p,v (heliocentric, J2000.0, au,au/d)
14940     *
14941     * <!-- Returned (function value): -->
14942     *  @return int          status: -1 = illegal NP (outside 1-8)
14943     *                                  0 = OK
14944     *                                 +1 = warning: year outside 1000-3000
14945     *                                 +2 = warning: failed to converge
14946     *
14947     * <p>Notes:
14948     * <ol>
14949     *
14950     * <li> The date date1+date2 is in the TDB time scale (in practice TT can
14951     *     be used) and is a Julian Date, apportioned in any convenient way
14952     *     between the two arguments.  For example, JD(TDB)=2450123.7 could
14953     *     be expressed in any of these ways, among others:
14954     *<pre>
14955     *            date1          date2
14956     *
14957     *         2450123.7           0.0       (JD method)
14958     *         2451545.0       -1421.3       (J2000 method)
14959     *         2400000.5       50123.2       (MJD method)
14960     *         2450123.5           0.2       (date &amp; time method)
14961     *</pre>
14962     *     The JD method is the most natural and convenient to use in cases
14963     *     where the loss of several decimal digits of resolution is
14964     *     acceptable.  The J2000 method is best matched to the way the
14965     *     argument is handled internally and will deliver the optimum
14966     *     resolution.  The MJD method and the date &amp; time methods are both
14967     *     good compromises between resolution and convenience.  The limited
14968     *     accuracy of the present algorithm is such that any of the methods
14969     *     is satisfactory.
14970     *
14971     * <li> If an np value outside the range 1-8 is supplied, an error status
14972     *     (function value -1) is returned and the pv vector set to zeroes.
14973     *
14974     * <li> For np=3 the result is for the Earth-Moon Barycenter.  To obtain
14975     *     the heliocentric position and velocity of the Earth, use instead
14976     *     the JSOFA function jauEpv00.
14977     *
14978     * <li> On successful return, the array pv contains the following:
14979     *<pre>
14980     *        pv[0][0]   x      }
14981     *        pv[0][1]   y      } heliocentric position, au
14982     *        pv[0][2]   z      }
14983     *
14984     *        pv[1][0]   xdot   }
14985     *        pv[1][1]   ydot   } heliocentric velocity, au/d
14986     *        pv[1][2]   zdot   }
14987     *</pre>
14988     *     The reference frame is equatorial and is with respect to the
14989     *     mean equator and equinox of epoch J2000.0.
14990     *
14991     * <li> The algorithm is due to J.L. Simon, P. Bretagnon, J. Chapront,
14992     *     M. Chapront-Touze, G. Francou and J. Laskar (Bureau des
14993     *     Longitudes, Paris, France).  From comparisons with JPL
14994     *     ephemeris DE102, they quote the following maximum errors
14995     *     over the interval 1800-2050:
14996     *<pre>
14997     *                     L (arcsec)    B (arcsec)      R (km)
14998     *
14999     *        Mercury          4             1             300
15000     *        Venus            5             1             800
15001     *        EMB              6             1            1000
15002     *        Mars            17             1            7700
15003     *        Jupiter         71             5           76000
15004     *        Saturn          81            13          267000
15005     *        Uranus          86             7          712000
15006     *        Neptune         11             1          253000
15007     *</pre>
15008     *     Over the interval 1000-3000, they report that the accuracy is no
15009     *     worse than 1.5 times that over 1800-2050.  Outside 1000-3000 the
15010     *     accuracy declines.
15011     *
15012     *     Comparisons of the present function with the JPL DE200 ephemeris
15013     *     give the following RMS errors over the interval 1960-2025:
15014     *<pre>
15015     *                      position (km)     velocity (m/s)
15016     *
15017     *        Mercury            334               0.437
15018     *        Venus             1060               0.855
15019     *        EMB               2010               0.815
15020     *        Mars              7690               1.98
15021     *        Jupiter          71700               7.70
15022     *        Saturn          199000              19.4
15023     *        Uranus          564000              16.4
15024     *        Neptune         158000              14.4
15025     *</pre>
15026     *     Comparisons against DE200 over the interval 1800-2100 gave the
15027     *     following maximum absolute differences.  (The results using
15028     *     DE406 were essentially the same.)
15029     *<pre>
15030     *                   L (arcsec)   B (arcsec)     R (km)   Rdot (m/s)
15031     *
15032     *        Mercury        7            1            500       0.7
15033     *        Venus          7            1           1100       0.9
15034     *        EMB            9            1           1300       1.0
15035     *        Mars          26            1           9000       2.5
15036     *        Jupiter       78            6          82000       8.2
15037     *        Saturn        87           14         263000      24.6
15038     *        Uranus        86            7         661000      27.4
15039     *        Neptune       11            2         248000      21.4
15040     *</pre>
15041     * <li> The present JSOFA re-implementation of the original Simon et al.
15042     *     Fortran code differs from the original in the following respects:
15043     *<ul>
15044     *       <li>  C instead of Fortran.
15045     *
15046     *       <li>  The date is supplied in two parts.
15047     *
15048     *       <li>  The result is returned only in equatorial Cartesian form;
15049     *          the ecliptic longitude, latitude and radius vector are not
15050     *          returned.
15051     *
15052     *       <li>  The result is in the J2000.0 equatorial frame, not ecliptic.
15053     *
15054     *       <li>  More is done in-line: there are fewer calls to subroutines.
15055     *
15056     *       <li>  Different error/warning status values are used.
15057     *
15058     *       <li>  A different Kepler's-equation-solver is used (avoiding
15059     *          use of double precision complex).
15060     *
15061     *       <li>  Polynomials in t are nested to minimize rounding errors.
15062     *
15063     *       <li>  Explicit double constants are used to avoid mixed-mode
15064     *          expressions.
15065     *</ul>
15066     *     None of the above changes affects the result significantly.
15067     *
15068     * <li> The returned status indicates the most serious condition
15069     *     encountered during execution of the function.  Illegal np is
15070     *     considered the most serious, overriding failure to converge,
15071     *     which in turn takes precedence over the remote date warning.
15072     *</ol>
15073     *<p>Called:<ul>
15074     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
15075     * </ul>
15076     *<p>Reference:  Simon, J.L, Bretagnon, P., Chapront, J.,
15077     *              Chapront-Touze, M., Francou, G., and Laskar, J.,
15078     *              Astron. Astrophys. 282, 663 (1994).
15079     *
15080     *@version 2009 December 17
15081     *
15082     *  @since Release 20101201
15083     *
15084     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15085     */
15086     public static int jauPlan94(double date1, double date2, int np, double pv[][])
15087     {
15088     /* Gaussian constant */
15089        final double GK = 0.017202098950;
15090 
15091     /* Sin and cos of J2000.0 mean obliquity (IAU 1976) */
15092        final double SINEPS = 0.3977771559319137;
15093        final double COSEPS = 0.9174820620691818;
15094 
15095     /* Maximum number of iterations allowed to solve Kepler's equation */
15096        final int KMAX = 10;
15097 
15098        int jstat, i, k;
15099        double t, da, dl, de, dp, di, dom, dmu, arga, argl, am,
15100               ae, dae, ae2, at, r, v, si2, xq, xp, tl, xsw,
15101               xcw, xm2, xf, ci2, xms, xmc, xpxq2, x, y, z;
15102 
15103     /* Planetary inverse masses */
15104        final double amas[] = { 6023600.0,       /* Mercury */
15105                                        408523.5,       /* Venus   */
15106                                        328900.5,       /* EMB     */
15107                                       3098710.0,       /* Mars    */
15108                                          1047.355,     /* Jupiter */
15109                                          3498.5,       /* Saturn  */
15110                                         22869.0,       /* Uranus  */
15111                                         19314.0 };     /* Neptune */
15112 
15113     /*
15114     * Tables giving the mean Keplerian elements, limited to t^2 terms:
15115     *
15116     *   a       semi-major axis (au)
15117     *   dlm     mean longitude (degree and arcsecond)
15118     *   e       eccentricity
15119     *   pi      longitude of the perihelion (degree and arcsecond)
15120     *   dinc    inclination (degree and arcsecond)
15121     *   omega   longitude of the ascending node (degree and arcsecond)
15122     */
15123 
15124        final double a[][] = {
15125            {  0.3870983098,           0.0,     0.0 },  /* Mercury */
15126            {  0.7233298200,           0.0,     0.0 },  /* Venus   */
15127            {  1.0000010178,           0.0,     0.0 },  /* EMB     */
15128            {  1.5236793419,         3e-10,     0.0 },  /* Mars    */
15129            {  5.2026032092,     19132e-10, -39e-10 },  /* Jupiter */
15130            {  9.5549091915, -0.0000213896, 444e-10 },  /* Saturn  */
15131            { 19.2184460618,     -3716e-10, 979e-10 },  /* Uranus  */
15132            { 30.1103868694,    -16635e-10, 686e-10 }   /* Neptune */
15133        };
15134 
15135        final double dlm[][] = {
15136            { 252.25090552, 5381016286.88982,  -1.92789 },
15137            { 181.97980085, 2106641364.33548,   0.59381 },
15138            { 100.46645683, 1295977422.83429,  -2.04411 },
15139            { 355.43299958,  689050774.93988,   0.94264 },
15140            {  34.35151874,  109256603.77991, -30.60378 },
15141            {  50.07744430,   43996098.55732,  75.61614 },
15142            { 314.05500511,   15424811.93933,  -1.75083 },
15143            { 304.34866548,    7865503.20744,   0.21103 }
15144        };
15145 
15146        final double e[][] = {
15147            { 0.2056317526,  0.0002040653,    -28349e-10 },
15148            { 0.0067719164, -0.0004776521,     98127e-10 },
15149            { 0.0167086342, -0.0004203654, -0.0000126734 },
15150            { 0.0934006477,  0.0009048438,    -80641e-10 },
15151            { 0.0484979255,  0.0016322542, -0.0000471366 },
15152            { 0.0555481426, -0.0034664062, -0.0000643639 },
15153            { 0.0463812221, -0.0002729293,  0.0000078913 },
15154            { 0.0094557470,  0.0000603263,           0.0 }
15155        };
15156 
15157        final double pi[][] = {
15158            {  77.45611904,  5719.11590,   -4.83016 },
15159            { 131.56370300,   175.48640, -498.48184 },
15160            { 102.93734808, 11612.35290,   53.27577 },
15161            { 336.06023395, 15980.45908,  -62.32800 },
15162            {  14.33120687,  7758.75163,  259.95938 },
15163            {  93.05723748, 20395.49439,  190.25952 },
15164            { 173.00529106,  3215.56238,  -34.09288 },
15165            {  48.12027554,  1050.71912,   27.39717 }
15166        };
15167 
15168        final double dinc[][] = {
15169            { 7.00498625, -214.25629,   0.28977 },
15170            { 3.39466189,  -30.84437, -11.67836 },
15171            {        0.0,  469.97289,  -3.35053 },
15172            { 1.84972648, -293.31722,  -8.11830 },
15173            { 1.30326698,  -71.55890,  11.95297 },
15174            { 2.48887878,   91.85195, -17.66225 },
15175            { 0.77319689,  -60.72723,   1.25759 },
15176            { 1.76995259,    8.12333,   0.08135 }
15177        };
15178 
15179        final double omega[][] = {
15180            {  48.33089304,  -4515.21727,  -31.79892 },
15181            {  76.67992019, -10008.48154,  -51.32614 },
15182            { 174.87317577,  -8679.27034,   15.34191 },
15183            {  49.55809321, -10620.90088, -230.57416 },
15184            { 100.46440702,   6362.03561,  326.52178 },
15185            { 113.66550252,  -9240.19942,  -66.23743 },
15186            {  74.00595701,   2669.15033,  145.93964 },
15187            { 131.78405702,   -221.94322,   -0.78728 }
15188        };
15189 
15190     /* Tables for trigonometric terms to be added to the mean elements of */
15191     /* the semi-major axes */
15192 
15193        final double kp[][] = {
15194         {   69613, 75645, 88306, 59899, 15746, 71087, 142173,  3086,    0 },
15195         {   21863, 32794, 26934, 10931, 26250, 43725,  53867, 28939,    0 },
15196         {   16002, 21863, 32004, 10931, 14529, 16368,  15318, 32794,    0 },
15197         {    6345,  7818, 15636,  7077,  8184, 14163,   1107,  4872,    0 },
15198         {    1760,  1454,  1167,   880,   287,  2640,     19,  2047, 1454 },
15199         {     574,     0,   880,   287,    19,  1760,   1167,   306,  574 },
15200         {     204,     0,   177,  1265,     4,   385,    200,   208,  204 },
15201         {       0,   102,   106,     4,    98,  1367,    487,   204,    0 }
15202        };
15203 
15204        final double ca[][] = {
15205         {       4,    -13,    11,   -9,    -9,   -3,     -1,     4,     0 },
15206         {    -156,     59,   -42,    6,    19,  -20,    -10,   -12,     0 },
15207         {      64,   -152,    62,   -8,    32,  -41,     19,   -11,     0 },
15208         {     124,    621,  -145,  208,    54,  -57,     30,    15,     0 },
15209         {  -23437,  -2634,  6601, 6259, -1507,-1821,   2620, -2115, -1489 },
15210         {   62911,-119919, 79336,17814,-24241,12068,   8306, -4893,  8902 },
15211         {  389061,-262125,-44088, 8387,-22976,-2093,   -615, -9720,  6633 },
15212         { -412235,-157046,-31430,37817, -9740,  -13,  -7449,  9644,     0 }
15213        };
15214 
15215        final double sa[][] = {
15216         {     -29,    -1,     9,     6,    -6,     5,     4,     0,     0 },
15217         {     -48,  -125,   -26,   -37,    18,   -13,   -20,    -2,     0 },
15218         {    -150,   -46,    68,    54,    14,    24,   -28,    22,     0 },
15219         {    -621,   532,  -694,   -20,   192,   -94,    71,   -73,     0 },
15220         {  -14614,-19828, -5869,  1881, -4372, -2255,   782,   930,   913 },
15221         {  139737,     0, 24667, 51123, -5102,  7429, -4095, -1976, -9566 },
15222         { -138081,     0, 37205,-49039,-41901,-33872,-27037,-12474, 18797 },
15223         {       0, 28492,133236, 69654, 52322,-49577,-26430, -3593,     0 }
15224        };
15225 
15226     /* Tables giving the trigonometric terms to be added to the mean */
15227     /* elements of the mean longitudes */
15228 
15229        final double kq[][] = {
15230         {   3086,15746,69613,59899,75645,88306, 12661,  2658,    0,     0 },
15231         {  21863,32794,10931,   73, 4387,26934,  1473,  2157,    0,     0 },
15232         {     10,16002,21863,10931, 1473,32004,  4387,    73,    0,     0 },
15233         {     10, 6345, 7818, 1107,15636, 7077,  8184,   532,   10,     0 },
15234         {     19, 1760, 1454,  287, 1167,  880,   574,  2640,   19,  1454 },
15235         {     19,  574,  287,  306, 1760,   12,    31,    38,   19,   574 },
15236         {      4,  204,  177,    8,   31,  200,  1265,   102,    4,   204 },
15237         {      4,  102,  106,    8,   98, 1367,   487,   204,    4,   102 }
15238        };
15239 
15240        final double cl[][] = {
15241         {      21,   -95, -157,   41,   -5,   42,  23,  30,      0,     0 },
15242         {    -160,  -313, -235,   60,  -74,  -76, -27,  34,      0,     0 },
15243         {    -325,  -322,  -79,  232,  -52,   97,  55, -41,      0,     0 },
15244         {    2268,  -979,  802,  602, -668,  -33, 345, 201,    -55,     0 },
15245         {    7610, -4997,-7689,-5841,-2617, 1115,-748,-607,   6074,   354 },
15246         {  -18549, 30125,20012, -730,  824,   23,1289,-352, -14767, -2062 },
15247         { -135245,-14594, 4197,-4030,-5630,-2898,2540,-306,   2939,  1986 },
15248         {   89948,  2103, 8963, 2695, 3682, 1648, 866,-154,  -1963,  -283 }
15249        };
15250 
15251        final double sl[][] = {
15252         {   -342,   136,  -23,   62,   66,  -52, -33,    17,     0,     0 },
15253         {    524,  -149,  -35,  117,  151,  122, -71,   -62,     0,     0 },
15254         {   -105,  -137,  258,   35, -116,  -88,-112,   -80,     0,     0 },
15255         {    854,  -205, -936, -240,  140, -341, -97,  -232,   536,     0 },
15256         { -56980,  8016, 1012, 1448,-3024,-3710, 318,   503,  3767,   577 },
15257         { 138606,-13478,-4964, 1441,-1319,-1482, 427,  1236, -9167, -1918 },
15258         {  71234,-41116, 5334,-4935,-1848,   66, 434, -1748,  3780,  -701 },
15259         { -47645, 11647, 2166, 3194,  679,    0,-244,  -419, -2531,    48 }
15260        };
15261 
15262     /*--------------------------------------------------------------------*/
15263 
15264     /* Validate the planet number. */
15265        if ((np < 1) || (np > 8)) {
15266           jstat = -1;
15267 
15268        /* Reset the result in case of failure. */
15269           for (k = 0; k < 2; k++) {
15270              for (i = 0; i < 3; i++) {
15271                 pv[k][i] = 0.0;
15272              }
15273           }
15274 
15275        } else {
15276 
15277        /* Decrement the planet number to start at zero. */
15278           np--;
15279 
15280        /* Time: Julian millennia since J2000.0. */
15281           t = ((date1 - DJ00) + date2) / DJM;
15282 
15283        /* OK status unless remote date. */
15284           jstat = abs(t) <= 1.0 ? 0 : 1;
15285 
15286        /* Compute the mean elements. */
15287           da = a[np][0] +
15288               (a[np][1] +
15289                a[np][2] * t) * t;
15290           dl = (3600.0 * dlm[np][0] +
15291                         (dlm[np][1] +
15292                          dlm[np][2] * t) * t) * DAS2R;
15293           de = e[np][0] +
15294              ( e[np][1] +
15295                e[np][2] * t) * t;
15296           dp = jauAnpm((3600.0 * pi[np][0] +
15297                                 (pi[np][1] +
15298                                  pi[np][2] * t) * t) * DAS2R);
15299           di = (3600.0 * dinc[np][0] +
15300                         (dinc[np][1] +
15301                          dinc[np][2] * t) * t) * DAS2R;
15302           dom = jauAnpm((3600.0 * omega[np][0] +
15303                                  (omega[np][1] +
15304                                   omega[np][2] * t) * t) * DAS2R);
15305 
15306        /* Apply the trigonometric terms. */
15307           dmu = 0.35953620 * t;
15308           for (k = 0; k < 8; k++) {
15309              arga = kp[np][k] * dmu;
15310              argl = kq[np][k] * dmu;
15311              da += (ca[np][k] * cos(arga) +
15312                     sa[np][k] * sin(arga)) * 1e-7;
15313              dl += (cl[np][k] * cos(argl) +
15314                     sl[np][k] * sin(argl)) * 1e-7;
15315           }
15316           arga = kp[np][8] * dmu;
15317           da += t * (ca[np][8] * cos(arga) +
15318                      sa[np][8] * sin(arga)) * 1e-7;
15319           for (k = 8; k < 10; k++) {
15320              argl = kq[np][k] * dmu;
15321              dl += t * (cl[np][k] * cos(argl) +
15322                         sl[np][k] * sin(argl)) * 1e-7;
15323           }
15324           dl = fmod(dl, D2PI);
15325 
15326        /* Iterative soln. of Kepler's equation to get eccentric anomaly. */
15327           am = dl - dp;
15328           ae = am + de * sin(am);
15329           k = 0;
15330           dae = 1.0;
15331           while (k < KMAX && abs(dae) > 1e-12) {
15332              dae = (am - ae + de * sin(ae)) / (1.0 - de * cos(ae));
15333              ae += dae;
15334              k++;
15335              if (k == KMAX-1) jstat = 2;
15336           }
15337 
15338        /* True anomaly. */
15339           ae2 = ae / 2.0;
15340           at = 2.0 * atan2(sqrt((1.0 + de) / (1.0 - de)) * sin(ae2),
15341                                                            cos(ae2));
15342 
15343        /* Distance (au) and speed (radians per day). */
15344           r = da * (1.0 - de * cos(ae));
15345           v = GK * sqrt((1.0 + 1.0 / amas[np]) / (da * da * da));
15346 
15347           si2 = sin(di / 2.0);
15348           xq = si2 * cos(dom);
15349           xp = si2 * sin(dom);
15350           tl = at + dp;
15351           xsw = sin(tl);
15352           xcw = cos(tl);
15353           xm2 = 2.0 * (xp * xcw - xq * xsw);
15354           xf = da / sqrt(1  -  de * de);
15355           ci2 = cos(di / 2.0);
15356           xms = (de * sin(dp) + xsw) * xf;
15357           xmc = (de * cos(dp) + xcw) * xf;
15358           xpxq2 = 2 * xp * xq;
15359 
15360        /* Position (J2000.0 ecliptic x,y,z in au). */
15361           x = r * (xcw - xm2 * xp);
15362           y = r * (xsw + xm2 * xq);
15363           z = r * (-xm2 * ci2);
15364 
15365        /* Rotate to equatorial. */
15366           pv[0][0] = x;
15367           pv[0][1] = y * COSEPS - z * SINEPS;
15368           pv[0][2] = y * SINEPS + z * COSEPS;
15369 
15370        /* Velocity (J2000.0 ecliptic xdot,ydot,zdot in au/d). */
15371           x = v * (( -1.0 + 2.0 * xp * xp) * xms + xpxq2 * xmc);
15372           y = v * ((  1.0 - 2.0 * xq * xq) * xmc - xpxq2 * xms);
15373           z = v * (2.0 * ci2 * (xp * xms + xq * xmc));
15374 
15375        /* Rotate to equatorial. */
15376           pv[1][0] = x;
15377           pv[1][1] = y * COSEPS - z * SINEPS;
15378           pv[1][2] = y * SINEPS + z * COSEPS;
15379 
15380        }
15381 
15382     /* Return the status. */
15383        return jstat;
15384 
15385         }
15386     
15387 
15388     /**
15389     *  Modulus of p-vector.
15390     *
15391     *<p>This function is derived from the International Astronomical Union's
15392     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15393     *
15394     *<p>Status:  vector/matrix support function.
15395     *
15396     *<!-- Given: -->
15397     *     @param p       double[3]      p-vector
15398     *
15399     * <!-- Returned (function value): -->
15400     *  @return double        modulus
15401     *
15402     *@version 2008 May 22
15403     *
15404     *  @since Release 20101201
15405     *
15406     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15407     */
15408     public static double jauPm(double p[] )
15409     {
15410        double w;
15411 
15412 
15413        w  = sqrt( p[0] * p[0]
15414                 + p[1] * p[1]
15415                 + p[2] * p[2] );
15416 
15417        return w;
15418 
15419         }
15420     
15421 
15422     /**
15423     *  Precession matrix (including frame bias) from GCRS to a specified
15424     *  date, IAU 2000 model.
15425     *
15426     *<p>This function is derived from the International Astronomical Union's
15427     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15428     *
15429     *<p>Status:  support function.
15430     *
15431     *<!-- Given: -->
15432     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15433     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15434     *
15435     *<!-- Returned: -->
15436     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15437     *
15438     * <p>Notes:
15439     * <ol>
15440     *
15441     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15442     *     convenient way between the two arguments.  For example,
15443     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15444     *     among others:
15445     *<pre>
15446     *            date1          date2
15447     *
15448     *         2450123.7           0.0       (JD method)
15449     *         2451545.0       -1421.3       (J2000 method)
15450     *         2400000.5       50123.2       (MJD method)
15451     *         2450123.5           0.2       (date &amp; time method)
15452     *</pre>
15453     *     The JD method is the most natural and convenient to use in
15454     *     cases where the loss of several decimal digits of resolution
15455     *     is acceptable.  The J2000 method is best matched to the way
15456     *     the argument is handled internally and will deliver the
15457     *     optimum resolution.  The MJD method and the date &amp; time methods
15458     *     are both good compromises between resolution and convenience.
15459     *
15460     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15461     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15462     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15463     *     respect to the mean equatorial triad of the given date.
15464     *</ol>
15465     *<p>Called:<ul>
15466     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15467     * </ul>
15468     *<p>Reference:
15469     *
15470     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
15471     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
15472     *     (2000)
15473     *
15474     *@version 2009 December 21
15475     *
15476     *  @since Release 20101201
15477     *
15478     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15479     */
15480     public static double[][] jauPmat00(double date1, double date2)
15481     {
15482        double rb[][] = new double[3][3], rp[][] = new double[3][3],
15483            rbp[][] = new double[3][3];
15484     /* Obtain the required matrix (discarding others). */
15485        jauBp00(date1, date2, rb, rp, rbp);
15486 
15487        return rbp;
15488 
15489         }
15490     
15491 
15492     /**
15493     *  Precession matrix (including frame bias) from GCRS to a specified
15494     *  date, IAU 2006 model.
15495     *
15496     *<p>This function is derived from the International Astronomical Union's
15497     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15498     *
15499     *<p>Status:  support function.
15500     *
15501     *<!-- Given: -->
15502     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15503     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15504     *
15505     *<!-- Returned: -->
15506     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15507     *
15508     * <p>Notes:
15509     * <ol>
15510     *
15511     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15512     *     convenient way between the two arguments.  For example,
15513     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15514     *     among others:
15515     *<pre>
15516     *            date1          date2
15517     *
15518     *         2450123.7           0.0       (JD method)
15519     *         2451545.0       -1421.3       (J2000 method)
15520     *         2400000.5       50123.2       (MJD method)
15521     *         2450123.5           0.2       (date &amp; time method)
15522     *</pre>
15523     *     The JD method is the most natural and convenient to use in
15524     *     cases where the loss of several decimal digits of resolution
15525     *     is acceptable.  The J2000 method is best matched to the way
15526     *     the argument is handled internally and will deliver the
15527     *     optimum resolution.  The MJD method and the date &amp; time methods
15528     *     are both good compromises between resolution and convenience.
15529     *
15530     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15531     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15532     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15533     *     respect to the mean equatorial triad of the given date.
15534     *</ol>
15535     *<p>Called:<ul>
15536     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
15537     *     <li>{@link #jauFw2m} F-W angles to r-matrix
15538     * </ul>
15539     *<p>References:
15540     *
15541     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
15542     *
15543     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
15544     *
15545     *@version 2009 December 21
15546     *
15547     *  @since Release 20101201
15548     *
15549     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15550     */
15551     public static double[][] jauPmat06(double date1, double date2)
15552     {
15553 
15554     /* Bias-precession Fukushima-Williams angles. */
15555        FWPrecessionAngles fw = jauPfw06(date1, date2);
15556 
15557     /* Form the matrix. */
15558        double[][] rbp = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
15559 
15560        return rbp;
15561 
15562         }
15563     
15564 
15565     /**
15566     *  Precession matrix from J2000.0 to a specified date, IAU 1976 model.
15567     *
15568     *<p>This function is derived from the International Astronomical Union's
15569     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15570     *
15571     *<p>Status:  support function.
15572     *
15573     *<!-- Given: -->
15574     *     @param date1 double        ending date, TT (Note 1)
15575     *     @param date2 double        ending date, TT (Note 1) 
15576     *
15577     *<!-- Returned: -->
15578     *     @return rmatp        double[3][3]   <u>returned</u> precession matrix, J2000.0 -&gt; date1+date2
15579     *
15580     * <p>Notes:
15581     * <ol>
15582     *
15583     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15584     *     convenient way between the two arguments.  For example,
15585     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15586     *     among others:
15587     *<pre>
15588     *            date1          date2
15589     *
15590     *         2450123.7           0.0       (JD method)
15591     *         2451545.0       -1421.3       (J2000 method)
15592     *         2400000.5       50123.2       (MJD method)
15593     *         2450123.5           0.2       (date &amp; time method)
15594     *</pre>
15595     *     The JD method is the most natural and convenient to use in
15596     *     cases where the loss of several decimal digits of resolution
15597     *     is acceptable.  The J2000 method is best matched to the way
15598     *     the argument is handled internally and will deliver the
15599     *     optimum resolution.  The MJD method and the date &amp; time methods
15600     *     are both good compromises between resolution and convenience.
15601     *
15602     * <li> The matrix operates in the sense V(date) = RMATP * V(J2000),
15603     *     where the p-vector V(J2000) is with respect to the mean
15604     *     equatorial triad of epoch J2000.0 and the p-vector V(date)
15605     *     is with respect to the mean equatorial triad of the given
15606     *     date.
15607     *
15608     * <li> Though the matrix method itself is rigorous, the precession
15609     *     angles are expressed through canonical polynomials which are
15610     *     valid only for a limited time span.  In addition, the IAU 1976
15611     *     precession rate is known to be imperfect.  The absolute accuracy
15612     *     of the present formulation is better than 0.1 arcsec from
15613     *     1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD,
15614     *     and remains below 3 arcsec for the whole of the period
15615     *     500BC to 3000AD.  The errors exceed 10 arcsec outside the
15616     *     range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to
15617     *     5600AD and exceed 1000 arcsec outside 6800BC to 8200AD.
15618     *</ol>
15619     *<p>Called:<ul>
15620     *     <li>{@link #jauPrec76} accumulated precession angles, IAU 1976
15621     *     <li>{@link #jauIr} initialize r-matrix to identity
15622     *     <li>{@link #jauRz} rotate around Z-axis
15623     *     <li>{@link #jauRy} rotate around Y-axis
15624     *     <li>{@link #jauCr} copy r-matrix
15625     * </ul>
15626     *<p>References:
15627     *
15628     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
15629     *      equations (6) &amp; (7), p283.
15630     *
15631     *     Kaplan,G.H., 1981. USNO circular no. 163, pA2.
15632     *
15633     *@version 2009 December 18
15634     *
15635     *  @since Release 20101201
15636     *
15637     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15638     */
15639     public static double[][] jauPmat76(double date1, double date2)
15640     {
15641        double wmat[][] = new double[3][3];
15642        double rmatp[][] = new double[3][3];
15643 
15644     /* Precession Euler angles, J2000.0 to specified date. */
15645        EulerAngles euler = jauPrec76(DJ00, 0.0, date1, date2);
15646 
15647     /* Form the rotation matrix. */
15648        jauIr(  wmat);
15649        jauRz( -euler.zeta, wmat);
15650        jauRy(  euler.theta, wmat);
15651        jauRz( -euler.z, wmat);
15652        jauCr(wmat, rmatp);
15653 
15654        return rmatp;
15655 
15656         }
15657     
15658 
15659     /**
15660     *  P-vector subtraction.
15661     *
15662     *<p>This function is derived from the International Astronomical Union's
15663     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15664     *
15665     *<p>Status:  vector/matrix support function.
15666     *
15667     *<!-- Given: -->
15668     *     @param a         double[3]       first p-vector
15669     *     @param b         double[3]       second p-vector
15670     *
15671     *<!-- Returned: -->
15672     *     @return amb       double[3]        <u>returned</u> a - b
15673     *
15674     *  Note:
15675     *     It is permissible to re-use the same array for any of the
15676     *     arguments.
15677     *
15678     *@version 2008 November 18
15679     *
15680     *  @since Release 20101201
15681     *
15682     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15683     */
15684     public static double[]  jauPmp(double a[] , double b[]  )
15685     {
15686        double amb[] = new double[3];
15687        amb[0] = a[0] - b[0];
15688        amb[1] = a[1] - b[1];
15689        amb[2] = a[2] - b[2];
15690 
15691        return amb;
15692 
15693         }
15694     
15695     /**
15696      * A normalized vector with r being the modulus and u[3] being the unit vector.
15697      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
15698      * 
15699      * @since AIDA Stage 1
15700      */
15701     public static class NormalizedVector {
15702         public double r;
15703         public double u[];
15704         public NormalizedVector(double r, double u[] ) {
15705             this.r = r;
15706             this.u = u;
15707         }
15708     }
15709     /**
15710     *  Convert a p-vector into modulus and unit vector.
15711     *
15712     *<p>This function is derived from the International Astronomical Union's
15713     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15714     *
15715     *<p>Status:  vector/matrix support function.
15716     *
15717     *<!-- Given: -->
15718     *     @param p         double[3]       p-vector
15719     *
15720     *<!-- Returned: -->
15721     *     @return r         double           <u>returned</u> modulus
15722     *             u         double[3]        <u>returned</u> unit vector
15723     *
15724     * <p>Notes:
15725     * <ol>
15726     *
15727     * <li> If p is null, the result is null.  Otherwise the result is a unit
15728     *     vector.
15729     *
15730     * <li> It is permissible to re-use the same array for any of the
15731     *     arguments.
15732     *</ol>
15733     *<p>Called:<ul>
15734     *     <li>{@link #jauPm} modulus of p-vector
15735     *     <li>{@link #jauZp} zero p-vector
15736     *     <li>{@link #jauSxp} multiply p-vector by scalar
15737     * </ul>
15738     *@version 2008 November 18
15739     *
15740     *  @since Release 20101201
15741     *
15742     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15743     */
15744     public static NormalizedVector jauPn(double p[])
15745     {
15746        double w;
15747 
15748     /* Obtain the modulus and test for zero. */
15749        w = jauPm(p);
15750        NormalizedVector nv = new NormalizedVector(w, new double[3]);
15751        if (w == 0.0) {
15752 
15753        /* Null vector. */
15754           jauZp(nv.u);
15755 
15756        } else {
15757 
15758        /* Unit vector. */
15759            nv.u = jauSxp(1.0/w, p);
15760        }
15761 
15762 
15763        return nv;
15764 
15765         }
15766     
15767 
15768     /**
15769     *  Precession-nutation, IAU 2000 model:  a multi-purpose function,
15770     *  supporting classical (equinox-based) use directly and CIO-based
15771     *  use indirectly.
15772     *
15773     *<p>This function is derived from the International Astronomical Union's
15774     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15775     *
15776     *<p>Status:  support function.
15777     *
15778     *<!-- Given: -->
15779     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15780     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15781     *     @param dpsi double           nutation (Note 2)
15782     *     @param deps double           nutation (Note 2) 
15783     *
15784     *<!-- Returned: -->
15785     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3),
15786     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4),
15787     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5),
15788     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6),
15789     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7),
15790     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8)
15791     *
15792     * <p>Notes:
15793     * <ol>
15794     *
15795     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15796     *     convenient way between the two arguments.  For example,
15797     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15798     *     among others:
15799     *<pre>
15800     *            date1          date2
15801     *
15802     *         2450123.7           0.0       (JD method)
15803     *         2451545.0       -1421.3       (J2000 method)
15804     *         2400000.5       50123.2       (MJD method)
15805     *         2450123.5           0.2       (date &amp; time method)
15806     *</pre>
15807     *     The JD method is the most natural and convenient to use in
15808     *     cases where the loss of several decimal digits of resolution
15809     *     is acceptable.  The J2000 method is best matched to the way
15810     *     the argument is handled internally and will deliver the
15811     *     optimum resolution.  The MJD method and the date &amp; time methods
15812     *     are both good compromises between resolution and convenience.
15813     *
15814     * <li> The caller is responsible for providing the nutation components;
15815     *     they are in longitude and obliquity, in radians and are with
15816     *     respect to the equinox and ecliptic of date.  For high-accuracy
15817     *     applications, free core nutation should be included as well as
15818     *     any other relevant corrections to the position of the CIP.
15819     *
15820     * <li> The returned mean obliquity is consistent with the IAU 2000
15821     *     precession-nutation models.
15822     *
15823     * <li> The matrix rb transforms vectors from GCRS to J2000.0 mean
15824     *     equator and equinox by applying frame bias.
15825     *
15826     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
15827     *     equinox to mean equator and equinox of date by applying
15828     *     precession.
15829     *
15830     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
15831     *     equinox of date by applying frame bias then precession.  It is
15832     *     the product rp x rb.
15833     *
15834     * <li> The matrix rn transforms vectors from mean equator and equinox of
15835     *     date to true equator and equinox of date by applying the nutation
15836     *     (luni-solar + planetary).
15837     *
15838     * <li> The matrix rbpn transforms vectors from GCRS to true equator and
15839     *     equinox of date.  It is the product rn x rbp, applying frame
15840     *     bias, precession and nutation in that order.
15841     *
15842     * <li> It is permissible to re-use the same array in the returned
15843     *     arguments.  The arrays are filled in the order given.
15844     *</ol>
15845     *<p>Called:<ul>
15846     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
15847     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
15848     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15849     *     <li>{@link #jauCr} copy r-matrix
15850     *     <li>{@link #jauNumat} form nutation matrix
15851     *     <li>{@link #jauRxr} product of two r-matrices
15852     * </ul>
15853     *<p>Reference:
15854     *
15855     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
15856     *     "Expressions for the Celestial Intermediate Pole and Celestial
15857     *     Ephemeris Origin consistent with the IAU 2000A precession-
15858     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
15859     *
15860     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
15861     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
15862     *
15863     *@version 2010 January 18
15864     *
15865     *  @since Release 20101201
15866     *
15867     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15868     */
15869     public static PrecessionNutation  jauPn00(double date1, double date2, double dpsi, double deps)
15870     {
15871        double  rbpw[][] = new double[3][3], rnw[][] = new double[3][3];
15872        double[][] rb = new double[3][3];
15873        double[][] rp = new double[3][3];
15874        double[][] rbp = new double[3][3];
15875        double[][] rn = new double[3][3];
15876        double[][] rbpn = new double[3][3];
15877 
15878 
15879     /* IAU 2000 precession-rate adjustments. */
15880        PrecessionDeltaTerms nut = jauPr00(date1, date2);
15881 
15882     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
15883        double epsa = jauObl80(date1, date2) + nut.depspr;
15884 
15885     /* Frame bias and precession matrices and their product. */
15886        jauBp00(date1, date2, rb, rp, rbpw);
15887        jauCr(rbpw, rbp);
15888 
15889     /* Nutation matrix. */
15890        rnw = jauNumat(epsa, dpsi, deps);
15891        jauCr(rnw, rn);
15892 
15893     /* Bias-precession-nutation matrix (classical). */
15894        rbpn = jauRxr(rnw, rbpw);
15895 
15896        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
15897 
15898         }
15899     
15900 
15901     /**
15902      * Precession-nutation model. 
15903      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
15904      * 
15905      * @since AIDA Stage 1
15906      */
15907     public static class PrecessionNutation {
15908         public NutationTerms nut;
15909         /** mean obliquity */
15910         public  double epsa;
15911         /** frame bias matrix */
15912         public double rb[][];
15913         /** precession matrix  */
15914         public  double rp[][];
15915         /** bias-precession matrix */
15916         public  double rbp[][];
15917         /** nutation matrix  */
15918         public double rn[][];
15919         /** GCRS-to-true matrix */
15920         public double rbpn[][];
15921         public PrecessionNutation(double dpsi, double deps, double epsa,
15922                   double rb[][], double rp[][], double rbp[][],
15923                   double rn[][], double rbpn[][]){
15924             this.nut = new NutationTerms(dpsi, deps);
15925             this.epsa = epsa;
15926             this.rb = rb; 
15927             this.rp = rp;
15928             this.rbp = rbp;
15929             this.rn = rn;
15930             this.rbpn = rbpn;
15931         }
15932         
15933     }
15934     /**
15935     *  Precession-nutation, IAU 2000A model:  a multi-purpose function,
15936     *  supporting classical (equinox-based) use directly and CIO-based
15937     *  use indirectly.
15938     *
15939     *<p>This function is derived from the International Astronomical Union's
15940     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15941     *
15942     *<p>Status:  support function.
15943     *
15944     *<!-- Given: -->
15945     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15946     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15947     *
15948     *<!-- Returned: -->
15949     *     @return dpsi double            <u>returned</u> nutation (Note 2)
15950     *             deps double            <u>returned</u> nutation (Note 2) 
15951     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
15952     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
15953     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
15954     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
15955     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
15956     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
15957     *
15958     * <p>Notes:
15959     * <ol>
15960     *
15961     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
15962     *      convenient way between the two arguments.  For example,
15963     *      JD(TT)=2450123.7 could be expressed in any of these ways,
15964     *      among others:
15965     *<pre>
15966     *             date1          date2
15967     *
15968     *          2450123.7           0.0       (JD method)
15969     *          2451545.0       -1421.3       (J2000 method)
15970     *          2400000.5       50123.2       (MJD method)
15971     *          2450123.5           0.2       (date &amp; time method)
15972     *</pre>
15973     *      The JD method is the most natural and convenient to use in
15974     *      cases where the loss of several decimal digits of resolution
15975     *      is acceptable.  The J2000 method is best matched to the way
15976     *      the argument is handled internally and will deliver the
15977     *      optimum resolution.  The MJD method and the date &amp; time methods
15978     *      are both good compromises between resolution and convenience.
15979     *
15980     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
15981     *      longitude and obliquity are in radians and with respect to the
15982     *      equinox and ecliptic of date.  Free core nutation is omitted;
15983     *      for the utmost accuracy, use the jauPn00  function, where the
15984     *      nutation components are caller-specified.  For faster but
15985     *      slightly less accurate results, use the jauPn00b function.
15986     *
15987     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
15988     *
15989     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
15990     *      equator and equinox by applying frame bias.
15991     *
15992     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
15993     *      equinox to mean equator and equinox of date by applying
15994     *      precession.
15995     *
15996     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
15997     *      equinox of date by applying frame bias then precession.  It is
15998     *      the product rp x rb.
15999     *
16000     * <li>  The matrix rn transforms vectors from mean equator and equinox
16001     *      of date to true equator and equinox of date by applying the
16002     *      nutation (luni-solar + planetary).
16003     *
16004     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16005     *      equinox of date.  It is the product rn x rbp, applying frame
16006     *      bias, precession and nutation in that order.
16007     *
16008     * <li>  The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate
16009     *      Pole are elements (3,1-3) of the GCRS-to-true matrix,
16010     *       i.e. rbpn[2][0-2].
16011     *
16012     *  <li> It is permissible to re-use the same array in the returned
16013     *      arguments.  The arrays are filled in the order given.
16014     *</ol>
16015     *<p>Called:<ul>
16016     *     <li>{@link #jauNut00a} nutation, IAU 2000A
16017     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16018     * </ul>
16019     *<p>Reference:
16020     *
16021     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16022     *     "Expressions for the Celestial Intermediate Pole and Celestial
16023     *     Ephemeris Origin consistent with the IAU 2000A precession-
16024     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
16025     *
16026     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16027     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16028     *
16029     *@version 2010 January 18
16030     *
16031     *  @since Release 20101201
16032     *
16033     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16034     */
16035     public static PrecessionNutation jauPn00a(double date1, double date2)
16036     {
16037     /* Nutation. */
16038        NutationTerms nut = jauNut00a(date1, date2);
16039 
16040     /* Remaining results. */
16041        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16042 
16043  
16044         }
16045     
16046 
16047     /**
16048     *  Precession-nutation, IAU 2000B model:  a multi-purpose function,
16049     *  supporting classical (equinox-based) use directly and CIO-based
16050     *  use indirectly.
16051     *
16052     *<p>This function is derived from the International Astronomical Union's
16053     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16054     *
16055     *<p>Status:  support function.
16056     *
16057     *<!-- Given: -->
16058     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16059     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16060     *
16061     *<!-- Returned: -->
16062     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16063     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
16064     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16065     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16066     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16067     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16068     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16069     *
16070     * <p>Notes:
16071     * <ol>
16072     *
16073     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16074     *      convenient way between the two arguments.  For example,
16075     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16076     *      among others:
16077     *<pre>
16078     *             date1          date2
16079     *
16080     *          2450123.7           0.0       (JD method)
16081     *          2451545.0       -1421.3       (J2000 method)
16082     *          2400000.5       50123.2       (MJD method)
16083     *          2450123.5           0.2       (date &amp; time method)
16084     *</pre>
16085     *      The JD method is the most natural and convenient to use in
16086     *      cases where the loss of several decimal digits of resolution
16087     *      is acceptable.  The J2000 method is best matched to the way
16088     *      the argument is handled internally and will deliver the
16089     *      optimum resolution.  The MJD method and the date &amp; time methods
16090     *      are both good compromises between resolution and convenience.
16091     *
16092     * <li>  The nutation components (luni-solar + planetary, IAU 2000B) in
16093     *      longitude and obliquity are in radians and with respect to the
16094     *      equinox and ecliptic of date.  For more accurate results, but
16095     *      at the cost of increased computation, use the jauPn00a function.
16096     *      For the utmost accuracy, use the jauPn00  function, where the
16097     *      nutation components are caller-specified.
16098     *
16099     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
16100     *
16101     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16102     *      equator and equinox by applying frame bias.
16103     *
16104     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16105     *      equinox to mean equator and equinox of date by applying
16106     *      precession.
16107     *
16108     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16109     *      equinox of date by applying frame bias then precession.  It is
16110     *      the product rp x rb.
16111     *
16112     * <li>  The matrix rn transforms vectors from mean equator and equinox
16113     *      of date to true equator and equinox of date by applying the
16114     *      nutation (luni-solar + planetary).
16115     *
16116     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16117     *      equinox of date.  It is the product rn x rbp, applying frame
16118     *      bias, precession and nutation in that order.
16119     *
16120     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16121     *      Pole are elements (3,1-3) of the matrix rbpn.
16122     *
16123     * <li> It is permissible to re-use the same array in the returned
16124     *      arguments.  The arrays are filled in the stated order.
16125     *</ol>
16126     *<p>Called:<ul>
16127     *     <li>{@link #jauNut00b} nutation, IAU 2000B
16128     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16129     * </ul>
16130     *<p>Reference:
16131     *
16132     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16133     *     "Expressions for the Celestial Intermediate Pole and Celestial
16134     *     Ephemeris Origin consistent with the IAU 2000A precession-
16135     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003).
16136     *
16137     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16138     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16139     *
16140     *@version 2010 January 18
16141     *
16142     *  @since Release 20101201
16143     *
16144     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16145     */
16146     public static PrecessionNutation jauPn00b(double date1, double date2)
16147     {
16148     /* Nutation. */
16149        NutationTerms nut = jauNut00b(date1, date2);
16150 
16151     /* Remaining results. */
16152        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16153 
16154 
16155         }
16156     
16157 
16158     /**
16159     *  Precession-nutation, IAU 2006 model:  a multi-purpose function,
16160     *  supporting classical (equinox-based) use directly and CIO-based use
16161     *  indirectly.
16162     *
16163     *<p>This function is derived from the International Astronomical Union's
16164     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16165     *
16166     *<p>Status:  support function.
16167     *
16168     *<!-- Given: -->
16169     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16170     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16171     *     @param dpsi double           nutation (Note 2)
16172     *     @param deps double           nutation (Note 2) 
16173     *
16174     *<!-- Returned: -->
16175     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3)
16176     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16177     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16178     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16179     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16180     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8)
16181     *
16182     * <p>Notes:
16183     * <ol>
16184     *
16185     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16186     *      convenient way between the two arguments.  For example,
16187     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16188     *      among others:
16189     *<pre>
16190     *             date1          date2
16191     *
16192     *          2450123.7           0.0       (JD method)
16193     *          2451545.0       -1421.3       (J2000 method)
16194     *          2400000.5       50123.2       (MJD method)
16195     *          2450123.5           0.2       (date &amp; time method)
16196     *</pre>
16197     *      The JD method is the most natural and convenient to use in
16198     *      cases where the loss of several decimal digits of resolution
16199     *      is acceptable.  The J2000 method is best matched to the way
16200     *      the argument is handled internally and will deliver the
16201     *      optimum resolution.  The MJD method and the date &amp; time methods
16202     *      are both good compromises between resolution and convenience.
16203     *
16204     * <li>  The caller is responsible for providing the nutation components;
16205     *      they are in longitude and obliquity, in radians and are with
16206     *      respect to the equinox and ecliptic of date.  For high-accuracy
16207     *      applications, free core nutation should be included as well as
16208     *      any other relevant corrections to the position of the CIP.
16209     *
16210     * <li>  The returned mean obliquity is consistent with the IAU 2006
16211     *      precession.
16212     *
16213     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16214     *      equator and equinox by applying frame bias.
16215     *
16216     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16217     *      equinox to mean equator and equinox of date by applying
16218     *      precession.
16219     *
16220     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16221     *      equinox of date by applying frame bias then precession.  It is
16222     *      the product rp x rb.
16223     *
16224     * <li>  The matrix rn transforms vectors from mean equator and equinox
16225     *      of date to true equator and equinox of date by applying the
16226     *      nutation (luni-solar + planetary).
16227     *
16228     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16229     *      equinox of date.  It is the product rn x rbp, applying frame
16230     *      bias, precession and nutation in that order.
16231     *
16232     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16233     *      Pole are elements (3,1-3) of the matrix rbpn.
16234     *
16235     *  <li> It is permissible to re-use the same array in the returned
16236     *      arguments.  The arrays are filled in the stated order.
16237     *</ol>
16238     *<p>Called:<ul>
16239     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16240     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16241     *     <li>{@link #jauCr} copy r-matrix
16242     *     <li>{@link #jauTr} transpose r-matrix
16243     *     <li>{@link #jauRxr} product of two r-matrices
16244     * </ul>
16245     *<p>References:
16246     *
16247     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16248     *
16249     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
16250     *
16251     *@version 2009 December 17
16252     *
16253     *  @since Release 20101201
16254     *
16255     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16256     */
16257     public static PrecessionNutation jauPn06(double date1, double date2, double dpsi, double deps)
16258     {
16259 
16260         double rb[][] = new double[3][3], rbp[][] = new double[3][3], rbpn[][] = new double[3][3];
16261     /* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */
16262        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
16263 
16264     /* B matrix. */
16265        double[][] r1 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
16266        jauCr(r1, rb);
16267 
16268     /* Bias-precession Fukushima-Williams angles of date. */
16269        fw = jauPfw06(date1, date2);
16270 
16271     /* Bias-precession matrix. */
16272        double[][] r2 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
16273        jauCr(r2, rbp);
16274 
16275     /* Solve for precession matrix. */
16276        double[][] rt = jauTr(r1);
16277        double[][] rp = jauRxr(r2, rt);
16278 
16279     /* Equinox-based bias-precession-nutation matrix. */
16280        r1 = jauFw2m(fw.gamb, fw.phib, fw.psib + dpsi, fw.epsa + deps);
16281        jauCr(r1, rbpn);
16282 
16283     /* Solve for nutation matrix. */
16284        rt = jauTr(r2);
16285        double[][] rn = jauRxr(r1, rt);
16286 
16287     /* Obliquity, mean of date. */
16288        double epsa = fw.epsa;
16289 
16290        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
16291 
16292         }
16293     
16294 
16295     /**
16296     *  Precession-nutation, IAU 2006/2000A models:  a multi-purpose function,
16297     *  supporting classical (equinox-based) use directly and CIO-based use
16298     *  indirectly.
16299     *
16300     *<p>This function is derived from the International Astronomical Union's
16301     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16302     *
16303     *<p>Status:  support function.
16304     *
16305     *<!-- Given: -->
16306     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16307     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16308     *
16309     *<!-- Returned: -->
16310     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16311     *            epsa          double            <u>returned</u> mean obliquity (Note 3)
16312     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16313     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16314     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16315     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16316     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16317     *
16318     * <p>Notes:
16319     * <ol>
16320     *
16321     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16322     *      convenient way between the two arguments.  For example,
16323     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16324     *      among others:
16325     *<pre>
16326     *             date1          date2
16327     *
16328     *          2450123.7           0.0       (JD method)
16329     *          2451545.0       -1421.3       (J2000 method)
16330     *          2400000.5       50123.2       (MJD method)
16331     *          2450123.5           0.2       (date &amp; time method)
16332     *</pre>
16333     *      The JD method is the most natural and convenient to use in
16334     *      cases where the loss of several decimal digits of resolution
16335     *      is acceptable.  The J2000 method is best matched to the way
16336     *      the argument is handled internally and will deliver the
16337     *      optimum resolution.  The MJD method and the date &amp; time methods
16338     *      are both good compromises between resolution and convenience.
16339     *
16340     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
16341     *      longitude and obliquity are in radians and with respect to the
16342     *      equinox and ecliptic of date.  Free core nutation is omitted;
16343     *      for the utmost accuracy, use the jauPn06 function, where the
16344     *      nutation components are caller-specified.
16345     *
16346     * <li>  The mean obliquity is consistent with the IAU 2006 precession.
16347     *
16348     * <li>  The matrix rb transforms vectors from GCRS to mean J2000.0 by
16349     *      applying frame bias.
16350     *
16351     * <li>  The matrix rp transforms vectors from mean J2000.0 to mean of
16352     *      date by applying precession.
16353     *
16354     * <li>  The matrix rbp transforms vectors from GCRS to mean of date by
16355     *      applying frame bias then precession.  It is the product rp x rb.
16356     *
16357     * <li>  The matrix rn transforms vectors from mean of date to true of
16358     *      date by applying the nutation (luni-solar + planetary).
16359     *
16360     * <li>  The matrix rbpn transforms vectors from GCRS to true of date
16361     *      (CIP/equinox).  It is the product rn x rbp, applying frame bias,
16362     *      precession and nutation in that order.
16363     *
16364     * <li>  The X,Y,Z coordinates of the IAU 2006/2000A Celestial
16365     *      Intermediate Pole are elements (1,1-3) of the matrix rbpn.
16366     *
16367     *  <li> It is permissible to re-use the same array in the returned
16368     *      arguments.  The arrays are filled in the stated order.
16369     *</ol>
16370     *<p>Called:<ul>
16371     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16372     *     <li>{@link #jauPn06} bias/precession/nutation results, IAU 2006
16373     * </ul>
16374     *<p>Reference:
16375     *
16376     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16377     *
16378     *@version 2009 December 18
16379     *
16380     *  @since Release 20101201
16381     *
16382     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16383     */
16384     public static PrecessionNutation jauPn06a(double date1, double date2)
16385     {
16386     /* Nutation. */
16387        NutationTerms nut = jauNut06a(date1, date2);
16388 
16389     /* Remaining results. */
16390        return jauPn06(date1, date2, nut.dpsi, nut.deps);
16391 
16392         }
16393     
16394 
16395     /**
16396     *  Form the matrix of precession-nutation for a given date (including
16397     *  frame bias), equinox-based, IAU 2000A model.
16398     *
16399     *<p>This function is derived from the International Astronomical Union's
16400     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16401     *
16402     *<p>Status:  support function.
16403     *
16404     *<!-- Given: -->
16405     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16406     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16407     *
16408     *<!-- Returned: -->
16409     *     @return rbpn          double[3][3]      <u>returned</u> classical NPB matrix (Note 2)
16410     *
16411     * <p>Notes:
16412     * <ol>
16413     *
16414     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16415     *     convenient way between the two arguments.  For example,
16416     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16417     *     among others:
16418     *<pre>
16419     *            date1          date2
16420     *
16421     *         2450123.7           0.0       (JD method)
16422     *         2451545.0       -1421.3       (J2000 method)
16423     *         2400000.5       50123.2       (MJD method)
16424     *         2450123.5           0.2       (date &amp; time method)
16425     *</pre>
16426     *     The JD method is the most natural and convenient to use in
16427     *     cases where the loss of several decimal digits of resolution
16428     *     is acceptable.  The J2000 method is best matched to the way
16429     *     the argument is handled internally and will deliver the
16430     *     optimum resolution.  The MJD method and the date &amp; time methods
16431     *     are both good compromises between resolution and convenience.
16432     *
16433     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16434     *     the p-vector V(date) is with respect to the true equatorial triad
16435     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16436     *     the Geocentric Celestial Reference System (IAU, 2000).
16437     *
16438     * <li> A faster, but slightly less accurate result (about 1 mas), can be
16439     *     obtained by using instead the jauPnm00b function.
16440     *</ol>
16441     *<p>Called:<ul>
16442     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
16443     * </ul>
16444     *<p>Reference:
16445     *
16446     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16447     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16448     *     (2000)
16449     *
16450     *@version 2009 December 21
16451     *
16452     *  @since Release 20101201
16453     *
16454     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16455     */
16456     public static double[][] jauPnm00a(double date1, double date2)
16457     {
16458 
16459     /* Obtain the required matrix (discarding other results). */
16460         PrecessionNutation pn = jauPn00a(date1, date2);
16461         return pn.rbpn;
16462 
16463     }
16464 
16465 
16466     /**
16467     *  Form the matrix of precession-nutation for a given date (including
16468     *  frame bias), equinox-based, IAU 2000B model.
16469     *
16470     *<p>This function is derived from the International Astronomical Union's
16471     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16472     *
16473     *<p>Status:  support function.
16474     *
16475     *<!-- Given: -->
16476     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16477     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16478     *
16479     *<!-- Returned: -->
16480     *     @return rbpn         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16481     *
16482     * <p>Notes:
16483     * <ol>
16484     *
16485     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16486     *     convenient way between the two arguments.  For example,
16487     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16488     *     among others:
16489     *<pre>
16490     *            date1          date2
16491     *
16492     *         2450123.7           0.0       (JD method)
16493     *         2451545.0       -1421.3       (J2000 method)
16494     *         2400000.5       50123.2       (MJD method)
16495     *         2450123.5           0.2       (date &amp; time method)
16496     *</pre>
16497     *     The JD method is the most natural and convenient to use in
16498     *     cases where the loss of several decimal digits of resolution
16499     *     is acceptable.  The J2000 method is best matched to the way
16500     *     the argument is handled internally and will deliver the
16501     *     optimum resolution.  The MJD method and the date &amp; time methods
16502     *     are both good compromises between resolution and convenience.
16503     *
16504     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16505     *     the p-vector V(date) is with respect to the true equatorial triad
16506     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16507     *     the Geocentric Celestial Reference System (IAU, 2000).
16508     *
16509     * <li> The present function is faster, but slightly less accurate (about
16510     *     1 mas), than the jauPnm00a function.
16511     *</ol>
16512     *<p>Called:<ul>
16513     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
16514     * </ul>
16515     *<p>Reference:
16516     *
16517     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16518     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16519     *     (2000)
16520     *
16521     *@version 2009 December 21
16522     *
16523     *  @since Release 20101201
16524     *
16525     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16526     */
16527     public static double[][] jauPnm00b(double date1, double date2)
16528     {
16529 
16530     /* Obtain the required matrix (discarding other results). */
16531        PrecessionNutation pn = jauPn00b(date1, date2);
16532 
16533        return pn.rbpn;
16534 
16535         }
16536     
16537 
16538     /**
16539     *  Form the matrix of precession-nutation for a given date (including
16540     *  frame bias), IAU 2006 precession and IAU 2000A nutation models.
16541     *
16542     *<p>This function is derived from the International Astronomical Union's
16543     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16544     *
16545     *<p>Status:  support function.
16546     *
16547     *<!-- Given: -->
16548     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16549     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16550     *
16551     *<!-- Returned: -->
16552     *     @return rnpb         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16553     *
16554     * <p>Notes:
16555     * <ol>
16556     *
16557     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16558     *     convenient way between the two arguments.  For example,
16559     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16560     *     among others:
16561     *<pre>
16562     *            date1          date2
16563     *
16564     *         2450123.7           0.0       (JD method)
16565     *         2451545.0       -1421.3       (J2000 method)
16566     *         2400000.5       50123.2       (MJD method)
16567     *         2450123.5           0.2       (date &amp; time method)
16568     *</pre>
16569     *     The JD method is the most natural and convenient to use in
16570     *     cases where the loss of several decimal digits of resolution
16571     *     is acceptable.  The J2000 method is best matched to the way
16572     *     the argument is handled internally and will deliver the
16573     *     optimum resolution.  The MJD method and the date &amp; time methods
16574     *     are both good compromises between resolution and convenience.
16575     *
16576     * <li> The matrix operates in the sense V(date) = rnpb * V(GCRS), where
16577     *     the p-vector V(date) is with respect to the true equatorial triad
16578     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16579     *     the Geocentric Celestial Reference System (IAU, 2000).
16580     *</ol>
16581     *<p>Called:<ul>
16582     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16583     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16584     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16585     * </ul>
16586     *<p>Reference:
16587     *
16588     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855.
16589     *
16590     *@version 2009 December 21
16591     *
16592     *  @since Release 20101201
16593     *
16594     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16595     */
16596     public static double[][] jauPnm06a(double date1, double date2)
16597     {
16598 
16599     /* Fukushima-Williams angles for frame bias and precession. */
16600        FWPrecessionAngles fw = jauPfw06(date1, date2);
16601 
16602     /* Nutation components. */
16603        NutationTerms nut = jauNut06a(date1, date2);
16604 
16605     /* Equinox based nutation x precession x bias matrix. */
16606        double[][] rnpb = jauFw2m(fw.gamb, fw.phib, fw.psib + nut.dpsi, fw.epsa + nut.deps);
16607 
16608        return rnpb;
16609 
16610         }
16611     
16612 
16613     /**
16614     *  Form the matrix of precession/nutation for a given date, IAU 1976
16615     *  precession model, IAU 1980 nutation model.
16616     *
16617     *<p>This function is derived from the International Astronomical Union's
16618     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16619     *
16620     *<p>Status:  support function.
16621     *
16622     *<!-- Given: -->
16623     *     @param date1 double          TDB date (Note 1)
16624     *     @param date2 double          TDB date (Note 1) 
16625     *
16626     *<!-- Returned: -->
16627     *     @return rmatpn          double[3][3]     <u>returned</u> combined precession/nutation matrix
16628     *
16629     * <p>Notes:
16630     * <ol>
16631     *
16632     * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
16633     *     convenient way between the two arguments.  For example,
16634     *     JD(TDB)=2450123.7 could be expressed in any of these ways,
16635     *     among others:
16636     *<pre>
16637     *            date1          date2
16638     *
16639     *         2450123.7           0.0       (JD method)
16640     *         2451545.0       -1421.3       (J2000 method)
16641     *         2400000.5       50123.2       (MJD method)
16642     *         2450123.5           0.2       (date &amp; time method)
16643     *</pre>
16644     *     The JD method is the most natural and convenient to use in
16645     *     cases where the loss of several decimal digits of resolution
16646     *     is acceptable.  The J2000 method is best matched to the way
16647     *     the argument is handled internally and will deliver the
16648     *     optimum resolution.  The MJD method and the date &amp; time methods
16649     *     are both good compromises between resolution and convenience.
16650     *
16651     * <li> The matrix operates in the sense V(date) = rmatpn * V(J2000),
16652     *     where the p-vector V(date) is with respect to the true equatorial
16653     *     triad of date date1+date2 and the p-vector V(J2000) is with
16654     *     respect to the mean equatorial triad of epoch J2000.0.
16655     *</ol>
16656     *<p>Called:<ul>
16657     *     <li>{@link #jauPmat76} precession matrix, IAU 1976
16658     *     <li>{@link #jauNutm80} nutation matrix, IAU 1980
16659     *     <li>{@link #jauRxr} product of two r-matrices
16660     * </ul>
16661     *<p>Reference:
16662     *
16663     *     <p>Explanatory Supplement to the Astronomical Almanac,
16664     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
16665     *     Section 3.3 (p145).
16666     *
16667     *@version 2010 January 23
16668     *
16669     *  @since Release 20101201
16670     *
16671     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16672     */
16673     public static double[][] jauPnm80(double date1, double date2)
16674     {
16675        double rmatp[][] = new double[3][3], rmatn[][] = new double[3][3];
16676 
16677 
16678     /* Precession matrix, J2000.0 to date. */
16679        rmatp = jauPmat76(date1, date2 );
16680 
16681     /* Nutation matrix. */
16682        rmatn = jauNutm80(date1, date2);
16683 
16684     /* Combine the matrices:  PN = N x P. */
16685        double[][] rmatpn = jauRxr(rmatn, rmatp);
16686 
16687        return rmatpn;
16688 
16689         }
16690     
16691 
16692     /**
16693     *  Form the matrix of polar motion for a given date, IAU 2000.
16694     *
16695     *<p>This function is derived from the International Astronomical Union's
16696     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16697     *
16698     *<p>Status:  support function.
16699     *
16700     *<!-- Given: -->
16701     *     @param xp double     coordinates of the pole (radians, Note 1)
16702     *     @param yp double     coordinates of the pole (radians, Note 1) 
16703     *     @param sp        double     the TIO locator s' (radians, Note 2)
16704     *
16705     *<!-- Returned: -->
16706     *     @return     double[3][3]     <u>returned</u> polar-motion matrix (Note 3)
16707     *
16708     * <p>Notes:
16709     * <ol>
16710     *
16711     * <li> The arguments xp and yp are the coordinates (in radians) of the
16712     *     Celestial Intermediate Pole with respect to the International
16713     *     Terrestrial Reference System (see IERS Conventions 2003),
16714     *     measured along the meridians to 0 and 90 deg west respectively.
16715     *
16716     * <li> The argument sp is the TIO locator s', in radians, which
16717     *     positions the Terrestrial Intermediate Origin on the equator.  It
16718     *     is obtained from polar motion observations by numerical
16719     *     integration, and so is in essence unpredictable.  However, it is
16720     *     dominated by a secular drift of about 47 microarcseconds per
16721     *     century, and so can be taken into account by using s' = -47*t,
16722     *     where t is centuries since J2000.0.  The function jauSp00
16723     *     implements this approximation.
16724     *
16725     * <li> The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning
16726     *     that it is the final rotation when computing the pointing
16727     *     direction to a celestial source.
16728     *</ol>
16729     *<p>Called:<ul>
16730     *     <li>{@link #jauIr} initialize r-matrix to identity
16731     *     <li>{@link #jauRz} rotate around Z-axis
16732     *     <li>{@link #jauRy} rotate around Y-axis
16733     *     <li>{@link #jauRx} rotate around X-axis
16734     * </ul>
16735     *<p>Reference:
16736     *
16737     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
16738     *     IERS Technical Note No. 32, BKG (2004)
16739     *
16740     *@version 2009 December 17
16741     *
16742     *  @since Release 20101201
16743     *
16744     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16745     */
16746     public static double[][] jauPom00(double xp, double yp, double sp)
16747     {
16748 
16749     /* Construct the matrix. */
16750        double rpom[][] = new double[3][3];
16751        jauIr(rpom);
16752        jauRz(sp, rpom);
16753        jauRy(-xp, rpom);
16754        jauRx(-yp, rpom);
16755 
16756        return rpom;
16757 
16758         }
16759     
16760 
16761     /**
16762     *  P-vector addition.
16763     *
16764     *<p>This function is derived from the International Astronomical Union's
16765     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16766     *
16767     *<p>Status:  vector/matrix support function.
16768     *
16769     *<!-- Given: -->
16770     *     @param a         double[3]       first p-vector
16771     *     @param b         double[3]       second p-vector
16772     *
16773     *<!-- Returned: -->
16774     *     @return apb       double[3]        <u>returned</u> a + b
16775     *
16776     *  Note:
16777     *     It is permissible to re-use the same array for any of the
16778     *     arguments.
16779     *
16780     *@version 2008 November 18
16781     *
16782     *  @since Release 20101201
16783     *
16784     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16785     */
16786     public static double[] jauPpp(double a[] , double b[] )
16787     {
16788        double apb[] = new double[3]; 
16789        apb[0] = a[0] + b[0];
16790        apb[1] = a[1] + b[1];
16791        apb[2] = a[2] + b[2];
16792 
16793        return apb;
16794 
16795      }
16796     
16797 
16798     /**
16799     *  P-vector plus scaled p-vector.
16800     *
16801     *<p>This function is derived from the International Astronomical Union's
16802     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16803     *
16804     *<p>Status:  vector/matrix support function.
16805     *
16806     *<!-- Given: -->
16807     *     @param a       double[3]      first p-vector
16808     *     @param s       double         scalar (multiplier for b)
16809     *     @param b       double[3]      second p-vector
16810     *
16811     *<!-- Returned: -->
16812     *     @return apsb    double[3]       <u>returned</u> a + s*b
16813     *
16814     *  Note:
16815     *     It is permissible for any of a, b and apsb to be the same array.
16816     *
16817     *<p>Called:<ul>
16818     *     <li>{@link #jauSxp} multiply p-vector by scalar
16819     *     <li>{@link #jauPpp} p-vector plus p-vector
16820     * </ul>
16821     *@version 2008 November 18
16822     *
16823     *  @since Release 20101201
16824     *
16825     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16826     */
16827     static double[] jauPpsp(double a[] , double s, double b[]  )
16828     {
16829        double sb[] = new double[3], apsb[];
16830 
16831 
16832     /* s*b. */
16833        sb = jauSxp(s,b);
16834 
16835     /* a + s*b. */
16836        apsb = jauPpp(a, sb);
16837 
16838        return apsb;
16839 
16840         }
16841     
16842     /**
16843      * Precession correction terms.
16844      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16845      * 
16846      * @since AIDA Stage 1
16847      */
16848     public static class PrecessionDeltaTerms {
16849         /**  precession correction in longitude  */
16850         public double dpsipr;
16851         /**  precession correction in obliquity */
16852         public double depspr;
16853         public PrecessionDeltaTerms(double dpsipr, double depspr) {
16854             this.dpsipr = dpsipr;
16855             this.depspr = depspr;
16856         }
16857     }
16858 
16859     /**
16860     *  Precession-rate part of the IAU 2000 precession-nutation models
16861     *  (part of MHB2000).
16862     *
16863     *<p>This function is derived from the International Astronomical Union's
16864     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16865     *
16866     *<p>Status:  canonical model.
16867     *
16868     *<!-- Given: -->
16869     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16870     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16871     *
16872     *<!-- Returned: -->
16873     *     @param dpsipr double    <u>returned</u> precession corrections (Notes 2,3)
16874     *     @param depspr double    <u>returned</u> precession corrections (Notes 2,3) 
16875     *
16876     * <p>Notes:
16877     * <ol>
16878     *
16879     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16880     *     convenient way between the two arguments.  For example,
16881     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16882     *     among others:
16883     *<pre>
16884     *            date1          date2
16885     *
16886     *         2450123.7           0.0       (JD method)
16887     *         2451545.0       -1421.3       (J2000 method)
16888     *         2400000.5       50123.2       (MJD method)
16889     *         2450123.5           0.2       (date &amp; time method)
16890     *</pre>
16891     *     The JD method is the most natural and convenient to use in
16892     *     cases where the loss of several decimal digits of resolution
16893     *     is acceptable.  The J2000 method is best matched to the way
16894     *     the argument is handled internally and will deliver the
16895     *     optimum resolution.  The MJD method and the date &amp; time methods
16896     *     are both good compromises between resolution and convenience.
16897     *
16898     * <li> The precession adjustments are expressed as "nutation
16899     *     components", corrections in longitude and obliquity with respect
16900     *     to the J2000.0 equinox and ecliptic.
16901     *
16902     * <li> Although the precession adjustments are stated to be with respect
16903     *     to Lieske et al. (1977), the MHB2000 model does not specify which
16904     *     set of Euler angles are to be used and how the adjustments are to
16905     *     be applied.  The most literal and straightforward procedure is to
16906     *     adopt the 4-rotation epsilon_0, psi_A, omega_A, xi_A option, and
16907     *     to add dpsipr to psi_A and depspr to both omega_A and eps_A.
16908     *
16909     * <li> This is an implementation of one aspect of the IAU 2000A nutation
16910     *     model, formally adopted by the IAU General Assembly in 2000,
16911     *     namely MHB2000 (Mathews et al. 2002).
16912     *
16913     *<p>References:
16914     *
16915     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B., "Expressions
16916     *     for the precession quantities based upon the IAU (1976) System of
16917     *     Astronomical Constants", Astron.Astrophys., 58, 1-16 (1977)
16918     *
16919     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
16920     *     and precession   New nutation series for nonrigid Earth and
16921     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
16922     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
16923     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
16924     *
16925     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
16926     *     Resolutions", in IERS Workshop 5.1 (2002).
16927     *
16928     *@version 2009 December 17
16929     *
16930     *  @since Release 20101201
16931     *
16932     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16933     */
16934     static PrecessionDeltaTerms jauPr00(double date1, double date2)
16935     {
16936        double t;
16937 
16938     /* Precession and obliquity corrections (radians per century) */
16939        final double PRECOR = -0.29965 * DAS2R,
16940                            OBLCOR = -0.02524 * DAS2R;
16941 
16942 
16943     /* Interval between fundamental epoch J2000.0 and given date (JC). */
16944        t = ((date1 - DJ00) + date2) / DJC;
16945 
16946     /* Precession rate contributions with respect to IAU 1976/80. */
16947        double dpsipr = PRECOR * t;
16948        double depspr = OBLCOR * t;
16949 
16950        return new PrecessionDeltaTerms(dpsipr, depspr);
16951 
16952         }
16953     
16954     /**
16955      * Euler Angles.
16956      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16957      * 
16958      * @since AIDA Stage 1
16959      */
16960     public static class EulerAngles {
16961         /** 1st rotation: radians cw around z */
16962         public double zeta;
16963         /** 3rd rotation: radians cw around z */
16964         public double z;
16965         /** 2nd rotation: radians ccw around y */
16966         public double theta;
16967         public EulerAngles(double zeta, double z, double theta){
16968             this.zeta = zeta;
16969             this.z = z;
16970             this.theta = theta;
16971         }
16972     }
16973                    
16974     /**
16975     *  IAU 1976 precession model.
16976     *
16977     *  This function forms the three Euler angles which implement general
16978     *  precession between two epochs, using the IAU 1976 model (as for
16979     *  the FK5 catalog).
16980     *
16981     *<p>This function is derived from the International Astronomical Union's
16982     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16983     *
16984     *<p>Status:  canonical model.
16985     *
16986     *<!-- Given: -->
16987     *     @param ep01 double     TDB starting epoch (Note 1)
16988     *     @param ep02 double     TDB starting epoch (Note 1) 
16989     *     @param ep11 double     TDB ending epoch (Note 1)
16990     *     @param ep12 double     TDB ending epoch (Note 1) 
16991     *
16992     *<!-- Returned: -->
16993     *     @param zeta         double      <u>returned</u> 1st rotation: radians cw around z
16994     *     @param z            double      <u>returned</u> 3rd rotation: radians cw around z
16995     *     @param theta        double      <u>returned</u> 2nd rotation: radians ccw around y
16996     *
16997     * <p>Notes:
16998     * <ol>
16999     *
17000     * <li> The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
17001     *     in any convenient way between the arguments epn1 and epn2.  For
17002     *     example, JD(TDB)=2450123.7 could be expressed in any of these
17003     *     ways, among others:
17004     *
17005     *             epn1          epn2
17006     *
17007     *         2450123.7           0.0       (JD method)
17008     *         2451545.0       -1421.3       (J2000 method)
17009     *         2400000.5       50123.2       (MJD method)
17010     *         2450123.5           0.2       (date &amp; time method)
17011     *</pre>
17012     *     The JD method is the most natural and convenient to use in cases
17013     *     where the loss of several decimal digits of resolution is
17014     *     acceptable.  The J2000 method is best matched to the way the
17015     *     argument is handled internally and will deliver the optimum
17016     *     optimum resolution.  The MJD method and the date &amp; time methods
17017     *     are both good compromises between resolution and convenience.
17018     *     The two epochs may be expressed using different methods, but at
17019     *     the risk of losing some resolution.
17020     *
17021     * <li> The accumulated precession angles zeta, z, theta are expressed
17022     *     through canonical polynomials which are valid only for a limited
17023     *     time span.  In addition, the IAU 1976 precession rate is known to
17024     *     be imperfect.  The absolute accuracy of the present formulation
17025     *     is better than 0.1 arcsec from 1960AD to 2040AD, better than
17026     *     1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for
17027     *     the whole of the period 500BC to 3000AD.  The errors exceed
17028     *     10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec
17029     *     outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to
17030     *     8200AD.
17031     *
17032     * <li> The three angles are returned in the conventional order, which
17033     *     is not the same as the order of the corresponding Euler
17034     *     rotations.  The precession matrix is
17035     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
17036     *
17037     *<p>Reference:
17038     *
17039     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations
17040     *     (6) &amp; (7), p283.
17041     *
17042     *@version 2009 December 17
17043     *
17044     *  @since Release 20101201
17045     *
17046     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17047     */
17048     static EulerAngles jauPrec76(double ep01, double ep02, double ep11, double ep12)
17049     {
17050        double t0, t, tas2r, w;
17051 
17052 
17053     /* Interval between fundamental epoch J2000.0 and start epoch (JC). */
17054        t0 = ((ep01 - DJ00) + ep02) / DJC;
17055 
17056     /* Interval over which precession required (JC). */
17057        t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
17058 
17059     /* Euler angles. */
17060        tas2r = t * DAS2R;
17061        w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0;
17062 
17063        double zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r;
17064 
17065        double z = (w + ((1.09468 + 0.000066 * t0) + 0.018203 * t) * t) * tas2r;
17066 
17067        double theta = ((2004.3109 + (-0.85330 - 0.000217 * t0) * t0)
17068               + ((-0.42665 - 0.000217 * t0) - 0.041833 * t) * t) * tas2r;
17069 
17070        return new EulerAngles(zeta, z, theta);
17071 
17072         }
17073     
17074 
17075     /**
17076     *  Discard velocity component of a pv-vector.
17077     *
17078     *<p>This function is derived from the International Astronomical Union's
17079     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17080     *
17081     *<p>Status:  vector/matrix support function.
17082     *
17083     *<!-- Given: -->
17084     *     @param pv       double[2][3]      pv-vector
17085     *
17086     *<!-- Returned: -->
17087     *     @return p        double[3]          <u>returned</u> p-vector
17088     *
17089     *<p>Called:<ul>
17090     *     <li>{@link #jauCp} copy p-vector
17091     * </ul>
17092     *@version 2008 May 11
17093     *
17094     *  @since Release 20101201
17095     *
17096     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17097     */
17098     public static double[] jauPv2p(double pv[][] )
17099     {
17100        double p[] = new double[3];
17101        jauCp(pv[0], p);
17102 
17103        return p;
17104 
17105         }
17106     
17107 
17108     /**
17109      * A position and velocity expressed in spherical polar coordinates.
17110      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17111      * 
17112      * @since AIDA Stage 1
17113      */
17114     public static class SphericalPositionVelocity {
17115         public SphericalPosition pos;
17116         public SphericalPosition vel;
17117         public SphericalPositionVelocity( double theta, double phi, double r,
17118                 double td, double pd, double rd) {
17119             pos = new SphericalPosition(theta, phi, r);
17120             vel = new SphericalPosition(td,pd,rd);
17121         }
17122     }
17123     /**
17124     *  Convert position/velocity from Cartesian to spherical coordinates.
17125     *
17126     *<p>This function is derived from the International Astronomical Union's
17127     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17128     *
17129     *<p>Status:  vector/matrix support function.
17130     *
17131     *<!-- Given: -->
17132     *     @param pv        double[2][3]   pv-vector
17133     *
17134     *<!-- Returned: -->
17135     *     @return theta     double          <u>returned</u> longitude angle (radians)
17136     *             phi       double          <u>returned</u> latitude angle (radians)
17137     *             r         double          <u>returned</u> radial distance
17138     *             td        double          <u>returned</u> rate of change of theta
17139     *             pd        double          <u>returned</u> rate of change of phi
17140     *             rd        double          <u>returned</u> rate of change of r
17141     *
17142     * <p>Notes:
17143     * <ol>
17144     *
17145     * <li> If the position part of pv is null, theta, phi, td and pd
17146     *     are indeterminate.  This is handled by extrapolating the
17147     *     position through unit time by using the velocity part of
17148     *     pv.  This moves the origin without changing the direction
17149     *     of the velocity component.  If the position and velocity
17150     *     components of pv are both null, zeroes are returned for all
17151     *     six results.
17152     *
17153     * <li> If the position is a pole, theta, td and pd are indeterminate.
17154     *     In such cases zeroes are returned for all three.
17155     *</ol>
17156     *@version 2008 October 28
17157     *
17158     *  @since Release 20101201
17159     *
17160     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17161     */
17162     public static SphericalPositionVelocity jauPv2s(double pv[][])
17163     {
17164        double x, y, z, xd, yd, zd, rxy2, rxy, r2, rtrue, rw, xyp;
17165        double theta, phi, r, td, pd, rd;
17166 
17167     /* Components of position/velocity vector. */
17168        x  = pv[0][0];
17169        y  = pv[0][1];
17170        z  = pv[0][2];
17171        xd = pv[1][0];
17172        yd = pv[1][1];
17173        zd = pv[1][2];
17174 
17175     /* Component of r in XY plane squared. */
17176        rxy2 = x*x + y*y;
17177 
17178     /* Modulus squared. */
17179        r2 = rxy2 + z*z;
17180 
17181     /* Modulus. */
17182        rtrue = sqrt(r2);
17183 
17184     /* If null vector, move the origin along the direction of movement. */
17185        rw = rtrue;
17186        if (rtrue == 0.0) {
17187            x = xd;
17188            y = yd;
17189            z = zd;
17190            rxy2 = x*x + y*y;
17191            r2 = rxy2 + z*z;
17192            rw = sqrt(r2);
17193        }
17194 
17195     /* Position and velocity in spherical coordinates. */
17196        rxy = sqrt(rxy2);
17197        xyp = x*xd + y*yd;
17198        if (rxy2 != 0.0) {
17199            theta = atan2(y, x);
17200            phi = atan2(z, rxy);
17201            td = (x*yd - y*xd) / rxy2;
17202            pd = (zd*rxy2 - z*xyp) / (r2*rxy);
17203        } else {
17204            theta = 0.0;
17205            phi = (z != 0.0) ? atan2(z, rxy) : 0.0;
17206            td = 0.0;
17207            pd = 0.0;
17208        }
17209        r = rtrue;
17210        rd = (rw != 0.0) ? (xyp + z*zd) / rw : 0.0;
17211 
17212        return new SphericalPositionVelocity(theta, phi, r, td, pd, rd);
17213 
17214         }
17215     
17216 
17217     /**
17218     *  Inner (=scalar=dot) product of two pv-vectors.
17219     *
17220     *<p>This function is derived from the International Astronomical Union's
17221     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17222     *
17223     *<p>Status:  vector/matrix support function.
17224     *
17225     *<!-- Given: -->
17226     *     @param a         double[2][3]       first pv-vector
17227     *     @param b         double[2][3]       second pv-vector
17228     *
17229     *<!-- Returned: -->
17230     *     @return adb       double[2]           <u>returned</u> a . b (see note)
17231     *
17232     *  Note:
17233     *
17234     *     If the position and velocity components of the two pv-vectors are
17235     *     ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of
17236     *     numbers ( ap . bp , ap . bv + av . bp ).  The two numbers are the
17237     *     dot-product of the two p-vectors and its derivative.
17238     *
17239     *<p>Called:<ul>
17240     *     <li>{@link #jauPdp} scalar product of two p-vectors
17241     * </ul>
17242     *@version 2008 May 22
17243     *
17244     *  @since Release 20101201
17245     *
17246     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17247     */
17248     public static double[] jauPvdpv(double a[][], double b[][] )
17249     {
17250        double adbd, addb, adb[] = new double[2];
17251 
17252 
17253     /* a . b = constant part of result. */
17254        adb[0] = jauPdp(a[0], b[0]);
17255 
17256     /* a . bdot */
17257        adbd = jauPdp(a[0], b[1]);
17258 
17259     /* adot . b */
17260        addb = jauPdp(a[1], b[0]);
17261 
17262     /* Velocity part of result. */
17263        adb[1] = adbd + addb;
17264 
17265        return adb;
17266 
17267         }
17268     
17269 
17270     /**
17271      * Modulus of pv-vector.
17272      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17273      * 
17274      * @since AIDA Stage 1
17275      */
17276     public static class PVModulus{
17277         public double r;
17278         public double s;
17279         public PVModulus( double r, double s){
17280             this.r = r;
17281             this.s = s;
17282         }
17283     }
17284     /**
17285     *  Modulus of pv-vector.
17286     *
17287     *<p>This function is derived from the International Astronomical Union's
17288     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17289     *
17290     *<p>Status:  vector/matrix support function.
17291     *
17292     *<!-- Given: -->
17293     *     @param pv      double[2][3]    pv-vector
17294     *
17295     *<!-- Returned: -->
17296     *     @return           modulus of position component,
17297     *                      modulus of velocity component
17298     *
17299     *<p>Called:<ul>
17300     *     <li>{@link #jauPm} modulus of p-vector
17301     * </ul>
17302     *@version 2008 May 22
17303     *
17304     *  @since Release 20101201
17305     *
17306     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17307     */
17308     public static PVModulus jauPvm(double pv[][])
17309     {
17310     /* Distance. */
17311        double r = jauPm(pv[0]);
17312 
17313     /* Speed. */
17314        double s = jauPm(pv[1]);
17315 
17316        return new PVModulus(r, s);
17317 
17318         }
17319     
17320 
17321     /**
17322     *  Subtract one pv-vector from another.
17323     *
17324     *<p>This function is derived from the International Astronomical Union's
17325     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17326     *
17327     *<p>Status:  vector/matrix support function.
17328     *
17329     *<!-- Given: -->
17330     *     @param a        double[2][3]       first pv-vector
17331     *     @param b        double[2][3]       second pv-vector
17332     *
17333     *<!-- Returned: -->
17334     *     @return      double[2][3]        <u>returned</u> a - b
17335     *
17336     *  Note:
17337     *     It is permissible to re-use the same array for any of the
17338     *     arguments.
17339     *
17340     *<p>Called:<ul>
17341     *     <li>{@link #jauPmp} p-vector minus p-vector
17342     * </ul>
17343     *@version 2008 November 18
17344     *
17345     *  @since Release 20101201
17346     *
17347     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17348     */
17349     public static double[][] jauPvmpv(double a[][], double b[][])
17350     {
17351        double amb[][] = new double[2][3];
17352        amb[0] = jauPmp(a[0], b[0]);
17353        amb[1] = jauPmp(a[1], b[1]);
17354 
17355        return amb;
17356 
17357         }
17358     
17359 
17360     /**
17361     *  Add one pv-vector to another.
17362     *
17363     *<p>This function is derived from the International Astronomical Union's
17364     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17365     *
17366     *<p>Status:  vector/matrix support function.
17367     *
17368     *<!-- Given: -->
17369     *     @param a         double[2][3]       first pv-vector
17370     *     @param b         double[2][3]       second pv-vector
17371     *
17372     *<!-- Returned: -->
17373     *     @return apb       double[2][3]        <u>returned</u> a + b
17374     *
17375     *  Note:
17376     *     It is permissible to re-use the same array for any of the
17377     *     arguments.
17378     *
17379     *<p>Called:<ul>
17380     *     <li>{@link #jauPpp} p-vector plus p-vector
17381     * </ul>
17382     *@version 2008 November 18
17383     *
17384     *  @since Release 20101201
17385     *
17386     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17387     */
17388     public static double[][] jauPvppv(double a[][], double b[][])
17389     {
17390        double apb[][] = new double[2][3];
17391        apb[0] = jauPpp(a[0], b[0]);
17392        apb[1] = jauPpp(a[1], b[1]);
17393 
17394        return apb;
17395 
17396         }
17397     
17398 
17399     /**
17400      * Typical catalogue coordinates. i.e. Position, proper motion, parallax and radial velocity.
17401      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17402      * 
17403      * @since AIDA Stage 1
17404      */
17405     public static class CatalogCoords {
17406         /** position (radians) */
17407         public SphericalCoordinate pos;
17408         /** proper motion (radians/year)*/
17409         public SphericalCoordinate pm;
17410         /** parallax (arcsec) */
17411         public double px;
17412         /** radial velocity (km/s, positive = receding) */
17413         public double rv;
17414         
17415         public CatalogCoords(double ra, double dec,
17416                 double pmr, double pmd, double px, double rv) {
17417             this.pos = new SphericalCoordinate(ra, dec);
17418             this.pm = new SphericalCoordinate(pmr, pmd);
17419             this.px = px;
17420             this.rv = rv;
17421         }
17422     }
17423     /**
17424     *  Convert star position+velocity vector to catalog coordinates.
17425     *
17426     *<p>This function is derived from the International Astronomical Union's
17427     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17428     *
17429     *<p>Status:  support function.
17430     *
17431     *  Given (Note 1):
17432     *    @param pv     double[2][3]   pv-vector (au, au/day)
17433     *
17434      *
17435     * <!-- Returned (function value): -->
17436     *  @return catalogue value
17437     *  
17438     *  int            status:
17439     *                              0 = OK
17440     *                             -1 = superluminal speed (Note 5)
17441     *                             -2 = null position vector
17442     *
17443     * <p>Notes:
17444     * <ol>
17445     *
17446     * <li> The specified pv-vector is the coordinate direction (and its rate
17447     *     of change) for the date at which the light leaving the star
17448     *     reached the solar-system barycenter.
17449     *
17450     * <li> The star data returned by this function are "observables" for an
17451     *     imaginary observer at the solar-system barycenter.  Proper motion
17452     *     and radial velocity are, strictly, in terms of barycentric
17453     *     coordinate time, TCB.  For most practical applications, it is
17454     *     permissible to neglect the distinction between TCB and ordinary
17455     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
17456     *     limited by the intrinsic accuracy of the proper-motion and
17457     *     radial-velocity data;  moreover, the supplied pv-vector is likely
17458     *     to be merely an intermediate result (for example generated by the
17459     *     function jauStarpv), so that a change of time unit will cancel
17460     *     out overall.
17461     *
17462     *     In accordance with normal star-catalog conventions, the object's
17463     *     right ascension and declination are freed from the effects of
17464     *     secular aberration.  The frame, which is aligned to the catalog
17465     *     equator and equinox, is Lorentzian and centered on the SSB.
17466     *
17467     *     Summarizing, the specified pv-vector is for most stars almost
17468     *     identical to the result of applying the standard geometrical
17469     *     "space motion" transformation to the catalog data.  The
17470     *     differences, which are the subject of the Stumpff paper cited
17471     *     below, are:
17472     *
17473     *     (i) In stars with significant radial velocity and proper motion,
17474     *     the constantly changing light-time distorts the apparent proper
17475     *     motion.  Note that this is a classical, not a relativistic,
17476     *     effect.
17477     *
17478     *     (ii) The transformation complies with special relativity.
17479     *
17480     * <li> Care is needed with units.  The star coordinates are in radians
17481     *     and the proper motions in radians per Julian year, but the
17482     *     parallax is in arcseconds; the radial velocity is in km/s, but
17483     *     the pv-vector result is in au and au/day.
17484     *
17485     * <li> The proper motions are the rate of change of the right ascension
17486     *     and declination at the catalog epoch and are in radians per Julian
17487     *     year.  The RA proper motion is in terms of coordinate angle, not
17488     *     true angle, and will thus be numerically larger at high
17489     *     declinations.
17490     *
17491     * <li> Straight-line motion at constant speed in the inertial frame is
17492     *     assumed.  If the speed is greater than or equal to the speed of
17493     *     light, the function aborts with an error status.
17494     *
17495     * <li> The inverse transformation is performed by the function jauStarpv.
17496     *</ol>
17497     *<p>Called:<ul>
17498     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
17499     *     <li>{@link #jauPdp} scalar product of two p-vectors
17500     *     <li>{@link #jauSxp} multiply p-vector by scalar
17501     *     <li>{@link #jauPmp} p-vector minus p-vector
17502     *     <li>{@link #jauPm} modulus of p-vector
17503     *     <li>{@link #jauPpp} p-vector plus p-vector
17504     *     <li>{@link #jauPv2s} pv-vector to spherical
17505     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
17506     * </ul>
17507     *<p>Reference:
17508     *
17509     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
17510     *
17511     *@version 2017 May 30
17512     *
17513     *  @since Release 20101201
17514     *
17515     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17516     */
17517     public static CatalogCoords jauPvstar(double pv[][]) throws JSOFAInternalError
17518     {
17519        double x[] = new double[3], vr, ur[] = new double[3], vt, ut[] = new double[3], bett, betr, d, w, del,
17520               usr[] = new double[3], ust[] = new double[3];
17521 
17522 
17523     /* Isolate the radial component of the velocity (au/day, inertial). */
17524        NormalizedVector nv = jauPn(pv[0]);
17525        x = nv.u;
17526        vr = jauPdp(x, pv[1]);
17527        ur = jauSxp(vr,x);
17528 
17529     /* Isolate the transverse component of the velocity (au/day, inertial). */
17530        ut = jauPmp(pv[1], ur);
17531        vt = jauPm(ut);
17532 
17533     /* Special-relativity dimensionless parameters. */
17534        bett = vt / DC;
17535        betr = vr / DC;
17536 
17537     /* The inertial-to-observed correction terms. */
17538        d = 1.0 + betr;
17539        w = betr*betr + bett*bett;
17540        if (d == 0.0 || w > 1) throw new JSOFAInternalError("Superluminal speed", -1);
17541        del = -w / (sqrt(1.0 -w) + 1.0);
17542 
17543     /* Apply relativistic correction factor to radial velocity component. */
17544        w = (betr != 0) ? (betr - del) / (betr * d) : 1.0;
17545        usr = jauSxp(w,ur);
17546 
17547     /* Apply relativistic correction factor to tangential velocity */
17548     /* component.                                                  */
17549        ust = jauSxp(1.0/d, ut);
17550 
17551     /* Combine the two to obtain the observed velocity vector (au/day). */
17552        pv[1] = jauPpp(usr, ust);
17553 
17554     /* Cartesian to spherical. */
17555        SphericalPositionVelocity pvs = jauPv2s(pv);
17556        if (pvs.pos.r == 0.0) throw new JSOFAInternalError("null position vector", -2);
17557 
17558     /* Return RA in range 0 to 2pi. */
17559        double ra = jauAnp(pvs.pos.theta);
17560 
17561     /* Return proper motions in radians per year. */
17562        double pmr = pvs.vel.theta * DJY;
17563        double pmd = pvs.vel.phi * DJY;
17564 
17565     /* Return parallax in arcsec. */
17566        double px = DR2AS / pvs.pos.r;
17567 
17568     /* Return radial velocity in km/s. */
17569        double rv = 1e-3 * pvs.vel.r * DAU / DAYSEC;
17570 
17571     /* OK status. */
17572        return new CatalogCoords(ra, pvs.pos.phi, pmr, pmd, px, rv);
17573 
17574         }
17575     
17576 
17577     /**
17578     *  Update a pv-vector.
17579     *
17580     *<p>This function is derived from the International Astronomical Union's
17581     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17582     *
17583     *<p>Status:  vector/matrix support function.
17584     *
17585     *<!-- Given: -->
17586     *     @param dt        double            time interval
17587     *     @param pv        double[2][3]      pv-vector
17588     *
17589     *<!-- Returned: -->
17590     *     @return upv       double[2][3]       <u>returned</u> p updated, v unchanged
17591     *
17592     * <p>Notes:
17593     * <ol>
17594     *
17595     * <li> "Update" means "refer the position component of the vector
17596     *     to a new date dt time units from the existing date".
17597     *
17598     * <li> The time units of dt must match those of the velocity.
17599     *
17600     * <li> It is permissible for pv and upv to be the same array.
17601     *</ol>
17602     *<p>Called:<ul>
17603     *     <li>{@link #jauPpsp} p-vector plus scaled p-vector
17604     *     <li>{@link #jauCp} copy p-vector
17605     * </ul>
17606     *@version 2008 November 17
17607     *
17608     *  @since Release 20101201
17609     *
17610     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17611     */
17612     public static double[][] jauPvu(double dt, double pv[][] )
17613     {
17614        double upv[][] = new double[2][3];
17615        upv[0] = jauPpsp(pv[0], dt, pv[1]);
17616        jauCp(pv[1], upv[1]);
17617 
17618        return upv;
17619 
17620         }
17621     
17622 
17623     /**
17624     *  Update a pv-vector, discarding the velocity component.
17625     *
17626     *<p>This function is derived from the International Astronomical Union's
17627     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17628     *
17629     *<p>Status:  vector/matrix support function.
17630     *
17631     *<!-- Given: -->
17632     *     @param dt        double             time interval
17633     *     @param pv        double[2][3]       pv-vector
17634     *
17635     *<!-- Returned: -->
17636     *     @return p         double[3]           <u>returned</u> p-vector
17637     *
17638     * <p>Notes:
17639     * <ol>
17640     *
17641     * <li> "Update" means "refer the position component of the vector to a
17642     *     new date dt time units from the existing date".
17643     *
17644     * <li> The time units of dt must match those of the velocity.
17645     *</ol>
17646     *@version 2008 May 11
17647     *
17648     *  @since Release 20101201
17649     *
17650     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17651     */
17652     public static double[] jauPvup(double dt, double pv[][] )
17653     {
17654         double p[] = new double[3];
17655        p[0] = pv[0][0] + dt * pv[1][0];
17656        p[1] = pv[0][1] + dt * pv[1][1];
17657        p[2] = pv[0][2] + dt * pv[1][2];
17658 
17659        return p;
17660 
17661         }
17662     
17663 
17664     /**
17665     *  Outer (=vector=cross) product of two pv-vectors.
17666     *
17667     *<p>This function is derived from the International Astronomical Union's
17668     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17669     *
17670     *<p>Status:  vector/matrix support function.
17671     *
17672     *<!-- Given: -->
17673     *     @param a         double[2][3]       first pv-vector
17674     *     @param b         double[2][3]       second pv-vector
17675     *
17676     *<!-- Returned: -->
17677     *     @return axb       double[2][3]        <u>returned</u> a x b
17678     *
17679     * <p>Notes:
17680     * <ol>
17681     *
17682     * <li> If the position and velocity components of the two pv-vectors are
17683     *     ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of
17684     *     vectors ( ap x bp, ap x bv + av x bp ).  The two vectors are the
17685     *     cross-product of the two p-vectors and its derivative.
17686     *
17687     * <li> It is permissible to re-use the same array for any of the
17688     *     arguments.
17689     *</ol>
17690     *<p>Called:<ul>
17691     *     <li>{@link #jauCpv} copy pv-vector
17692     *     <li>{@link #jauPxp} vector product of two p-vectors
17693     *     <li>{@link #jauPpp} p-vector plus p-vector
17694     * </ul>
17695     *@version 2008 November 18
17696     *
17697     *  @since Release 20101201
17698     *
17699     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17700     */
17701     public static double[][] jauPvxpv(double a[][], double b[][] )
17702     {
17703        double wa[][] = new double[2][3], wb[][] = new double[2][3], axbd[] = new double[3], adxb[] = new double[3];
17704 
17705        double axb[][] = new double[2][3];
17706     /* Make copies of the inputs. */
17707        jauCpv(a, wa);
17708        jauCpv(b, wb);
17709 
17710     /* a x b = position part of result. */
17711        axb[0] = jauPxp(wa[0], wb[0]);
17712 
17713     /* a x bdot + adot x b = velocity part of result. */
17714        axbd = jauPxp(wa[0],wb[1]);
17715        adxb = jauPxp(wa[1],wb[0]);
17716        axb[1] = jauPpp(axbd, adxb);
17717 
17718        return axb;
17719 
17720         }
17721     
17722 
17723     /**
17724     *  p-vector outer (=vector=cross) product.
17725     *
17726     *<p>This function is derived from the International Astronomical Union's
17727     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17728     *
17729     *<p>Status:  vector/matrix support function.
17730     *
17731     *<!-- Given: -->
17732     *     @param a         double[3]       first p-vector
17733     *     @param b         double[3]       second p-vector
17734     *
17735     *<!-- Returned: -->
17736     *     @return axb       double[3]        <u>returned</u> a x b
17737     *
17738     *  Note:
17739     *     It is permissible to re-use the same array for any of the
17740     *     arguments.
17741     *
17742     *@version 2008 November 18
17743     *
17744     *  @since Release 20101201
17745     *
17746     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17747     */
17748     public static double[] jauPxp(double a[] , double b[]  )
17749     {
17750        double xa, ya, za, xb, yb, zb;
17751        double axb[] = new double[3];
17752 
17753        xa = a[0];
17754        ya = a[1];
17755        za = a[2];
17756        xb = b[0];
17757        yb = b[1];
17758        zb = b[2];
17759        axb[0] = ya*zb - za*yb;
17760        axb[1] = za*xb - xa*zb;
17761        axb[2] = xa*yb - ya*xb;
17762 
17763        return axb;
17764 
17765         }
17766     
17767 
17768     /**
17769     *  Express an r-matrix as an r-vector.
17770     *
17771     *<p>This function is derived from the International Astronomical Union's
17772     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17773     *
17774     *<p>Status:  vector/matrix support function.
17775     *
17776     *<!-- Given: -->
17777     *     @param r         double[3][3]     rotation matrix
17778     *
17779     *<!-- Returned: -->
17780     *     @return w         double[3]         <u>returned</u> rotation vector (Note 1)
17781     *
17782     * <p>Notes:
17783     * <ol>
17784     *
17785     * <li> A rotation matrix describes a rotation through some angle about
17786     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17787     *     returned by this function has the same direction as the Euler axis,
17788     *     and its magnitude is the angle in radians.  (The magnitude and
17789     *     direction can be separated by means of the function jauPn.)
17790     *
17791     * <li> If r is null, so is the result.  If r is not a rotation matrix
17792     *     the result is undefined;  r must be proper (i.e. have a positive
17793     *     determinant) and real orthogonal (inverse = transpose).
17794     *
17795     * <li> The reference frame rotates clockwise as seen looking along
17796     *     the rotation vector from the origin.
17797     *</ol>
17798     *@version 2008 May 12
17799     *
17800     *  @since Release 20101201
17801     *
17802     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17803     */
17804     public static double[] jauRm2v(double r[][] )
17805     {
17806        double x, y, z, s2, c2, phi, f;
17807        double w[] = new double[3];
17808 
17809        x = r[1][2] - r[2][1];
17810        y = r[2][0] - r[0][2];
17811        z = r[0][1] - r[1][0];
17812        s2 = sqrt(x*x + y*y + z*z);
17813        if (s2 > 0) {
17814           c2 = r[0][0] + r[1][1] + r[2][2] - 1;
17815           phi = atan2(s2, c2);
17816           f =  phi / s2;
17817           w[0] = x * f;
17818           w[1] = y * f;
17819           w[2] = z * f;
17820        } else {
17821           w[0] = 0.0;
17822           w[1] = 0.0;
17823           w[2] = 0.0;
17824        }
17825 
17826        return w;
17827 
17828         }
17829     
17830 
17831     /**
17832     *  Form the r-matrix corresponding to a given r-vector.
17833     *
17834     *<p>This function is derived from the International Astronomical Union's
17835     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17836     *
17837     *<p>Status:  vector/matrix support function.
17838     *
17839     *<!-- Given: -->
17840     *     @param w         double[3]       rotation vector (Note 1)
17841     *
17842     *<!-- Returned: -->
17843     *     @return r         double[3][3]      <u>returned</u> rotation matrix
17844     *
17845     * <p>Notes:
17846     * <ol>
17847     *
17848     * <li> A rotation matrix describes a rotation through some angle about
17849     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17850     *     supplied to This function has the same direction as the Euler
17851     *     axis, and its magnitude is the angle in radians.
17852     *
17853     * <li> If w is null, the unit matrix is returned.
17854     *
17855     * <li> The reference frame rotates clockwise as seen looking along the
17856     *     rotation vector from the origin.
17857     *</ol>
17858     *@version 2008 May 11
17859     *
17860     *  @since Release 20101201
17861     *
17862     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17863     */
17864     public static double[][] jauRv2m(double w[])
17865     {
17866        double x, y, z, phi, s, c, f;
17867        double r[][] = new double[3][3];
17868 
17869 
17870     /* Euler angle (magnitude of rotation vector) and functions. */
17871        x = w[0];
17872        y = w[1];
17873        z = w[2];
17874        phi = sqrt(x*x + y*y + z*z);
17875        s = sin(phi);
17876        c = cos(phi);
17877        f = 1.0 - c;
17878 
17879     /* Euler axis (direction of rotation vector), perhaps null. */
17880        if (phi > 0.0) {
17881            x /= phi;
17882            y /= phi;
17883            z /= phi;
17884        }
17885 
17886     /* Form the rotation matrix. */
17887        r[0][0] = x*x*f + c;
17888        r[0][1] = x*y*f + z*s;
17889        r[0][2] = x*z*f - y*s;
17890        r[1][0] = y*x*f - z*s;
17891        r[1][1] = y*y*f + c;
17892        r[1][2] = y*z*f + x*s;
17893        r[2][0] = z*x*f + y*s;
17894        r[2][1] = z*y*f - x*s;
17895        r[2][2] = z*z*f + c;
17896 
17897        return r;
17898 
17899         }
17900     
17901 
17902     /**
17903     *  Rotate an r-matrix about the x-axis.
17904     *
17905     *<p>This function is derived from the International Astronomical Union's
17906     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17907     *
17908     *<p>Status:  vector/matrix support function.
17909     *
17910     *<!-- Given: -->
17911     *     @param phi     double           angle (radians)
17912     *
17913     *  Given and returned:
17914     *      @param r      double[3][3]    r-matrix <u>given and returned</u>
17915     *
17916     *  Sign convention:  The matrix can be used to rotate the reference
17917     *  frame of a vector.  Calling this function with positive phi
17918     *  incorporates in the matrix an additional rotation, about the x-axis,
17919     *  anticlockwise as seen looking towards the origin from positive x.
17920     *
17921     *<p>Called:<ul>
17922     *     <li>{@link #jauIr} initialize r-matrix to identity
17923     *     <li>{@link #jauRxr} product of two r-matrices
17924     *     <li>{@link #jauCr} copy r-matrix
17925     * </ul>
17926     *@version 2008 May 22
17927     *
17928     *  @since Release 20101201
17929     *
17930     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17931     */
17932     public static void jauRx(double phi, double r[][])
17933     {
17934        double s, c, a[][] = new double[3][3], w[][];
17935 
17936 
17937     /* Matrix representing new rotation. */
17938        s = sin(phi);
17939        c = cos(phi);
17940        jauIr(a);
17941        a[1][1] =  c;
17942        a[2][1] = -s;
17943        a[1][2] =  s;
17944        a[2][2] =  c;
17945 
17946     /* Rotate. */
17947        w = jauRxr(a, r);
17948 
17949     /* Return result. */
17950        jauCr(w, r);
17951 
17952        return;
17953 
17954         }
17955     
17956 
17957     /**
17958     *  Multiply a p-vector by an r-matrix.
17959     *
17960     *<p>This function is derived from the International Astronomical Union's
17961     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17962     *
17963     *<p>Status:  vector/matrix support function.
17964     *
17965     *<!-- Given: -->
17966     *     @param r         double[3][3]     r-matrix
17967     *     @param p         double[3]        p-vector
17968     *
17969     *<!-- Returned: -->
17970     *     @return rp        double[3]         <u>returned</u> r * p
17971     *
17972     *  Note:
17973     *     It is permissible for p and rp to be the same array.
17974     *
17975     *<p>Called:<ul>
17976     *     <li>{@link #jauCp} copy p-vector
17977     * </ul>
17978     *@version 2008 October 28
17979     *
17980     *  @since Release 20101201
17981     *
17982     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17983     */
17984     public static double[] jauRxp(double r[][], double p[])
17985     {
17986        double w, wrp[] = new double[3] ;
17987        int i, j;
17988 
17989 
17990     /* Matrix r * vector p. */
17991        for (j = 0; j < 3; j++) {
17992            w = 0.0;
17993            for (i = 0; i < 3; i++) {
17994                w += r[j][i] * p[i];
17995            }
17996            wrp[j] = w;
17997        }
17998 
17999 
18000        return wrp;
18001 
18002         }
18003     
18004 
18005     /**
18006     *  Multiply a pv-vector by an r-matrix.
18007     *
18008     *<p>This function is derived from the International Astronomical Union's
18009     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18010     *
18011     *<p>Status:  vector/matrix support function.
18012     *
18013     *<!-- Given: -->
18014     *     @param r         double[3][3]     r-matrix
18015     *     @param pv        double[2][3]     pv-vector
18016     *
18017     *<!-- Returned: -->
18018     *     @return rpv       double[2][3]      <u>returned</u> r * pv
18019     *
18020     *  Note:
18021     *     It is permissible for pv and rpv to be the same array.
18022     *
18023     *<p>Called:<ul>
18024     *     <li>{@link #jauRxp} product of r-matrix and p-vector
18025     * </ul>
18026     *@version 2008 October 28
18027     *
18028     *  @since Release 20101201
18029     *
18030     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18031     */
18032     public static double[][] jauRxpv(double r[][], double pv[][])
18033     {
18034        double rpv[][] = new double[2][0];
18035        rpv[0] = jauRxp(r, pv[0]);
18036        rpv[1] = jauRxp(r, pv[1]);
18037 
18038        return rpv;
18039 
18040         }
18041     
18042 
18043     /**
18044     *  Multiply two r-matrices.
18045     *
18046     *<p>This function is derived from the International Astronomical Union's
18047     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18048     *
18049     *<p>Status:  vector/matrix support function.
18050     *
18051     *<!-- Given: -->
18052     *     @param a         double[3][3]     first r-matrix
18053     *     @param b         double[3][3]     second r-matrix
18054     *
18055     *<!-- Returned: -->
18056     *     @return atb       double[3][3]      <u>returned</u> a * b
18057     *
18058     *  Note:
18059     *     It is permissible to re-use the same array for any of the
18060     *     arguments.
18061     *
18062     *<p>Called:<ul>
18063     *     <li>{@link #jauCr} copy r-matrix
18064     * </ul>
18065     *@version 2008 November 18
18066     *
18067     *  @since Release 20101201
18068     *
18069     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18070     */
18071     public static double[][] jauRxr(double a[][], double b[][])
18072     {
18073        int i, j, k;
18074        double w, wm[][] = new double[3][3];
18075 
18076 
18077        for (i = 0; i < 3; i++) {
18078           for (j = 0; j < 3; j++) {
18079              w = 0.0;
18080              for (k = 0; k < 3; k++) {
18081                 w +=  a[i][k] * b[k][j];
18082              }
18083              wm[i][j] = w;
18084           }
18085        }
18086 
18087        return wm;
18088 
18089      }
18090     
18091 
18092     /**
18093     *  Rotate an r-matrix about the y-axis.
18094     *
18095     *<p>This function is derived from the International Astronomical Union's
18096     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18097     *
18098     *<p>Status:  vector/matrix support function.
18099     *
18100     *<!-- Given: -->
18101     *     @param theta   double           angle (radians)
18102     *
18103     *  Given and returned:
18104     *     @param r      double[3][3]   <u>given &amp; returned</u> r-matrix
18105     *
18106     *  Sign convention:  The matrix can be used to rotate the reference
18107     *  frame of a vector.  Calling This function with positive theta
18108     *  incorporates in the matrix an additional rotation, about the y-axis,
18109     *  anticlockwise as seen looking towards the origin from positive y.
18110     *
18111     *<p>Called:<ul>
18112     *     <li>{@link #jauIr} initialize r-matrix to identity
18113     *     <li>{@link #jauRxr} product of two r-matrices
18114     *     <li>{@link #jauCr} copy r-matrix
18115     * </ul>
18116     *@version 2008 May 22
18117     *
18118     *  @since Release 20101201
18119     *
18120     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18121     */
18122     public static void jauRy(double theta, double r[][])
18123     {
18124        double s, c, a[][] = new double[3][3], w[][];
18125 
18126 
18127     /* Matrix representing new rotation. */
18128        s = sin(theta);
18129        c = cos(theta);
18130        jauIr(a);
18131        a[0][0] =  c;
18132        a[2][0] =  s;
18133        a[0][2] = -s;
18134        a[2][2] =  c;
18135 
18136     /* Rotate. */
18137        w = jauRxr(a, r);
18138 
18139     /* Return result. */
18140        jauCr(w, r);
18141 
18142        return;
18143 
18144         }
18145     
18146 
18147     /**
18148     *  Rotate an r-matrix about the z-axis.
18149     *
18150     *<p>This function is derived from the International Astronomical Union's
18151     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18152     *
18153     *<p>Status:  vector/matrix support function.
18154     *
18155     *<!-- Given: -->
18156     *     @param psi     double           angle (radians)
18157     *
18158     *  Given and returned:
18159     *     @param r      double[3][3]    <u>given &amp; retuned</u>r-matrix, rotated
18160     *
18161     *  Sign convention:  The matrix can be used to rotate the reference
18162     *  frame of a vector.  Calling This function with positive psi
18163     *  incorporates in the matrix an additional rotation, about the z-axis,
18164     *  anticlockwise as seen looking towards the origin from positive z.
18165     *
18166     *<p>Called:<ul>
18167     *     <li>{@link #jauIr} initialize r-matrix to identity
18168     *     <li>{@link #jauRxr} product of two r-matrices
18169     *     <li>{@link #jauCr} copy r-matrix
18170     * </ul>
18171     *@version 2008 May 22
18172     *
18173     *  @since Release 20101201
18174     *
18175     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18176     */
18177     public static void jauRz(double psi, double r[][])
18178     {
18179        double s, c, a[][] = new double[3][3], w[][];
18180 
18181 
18182     /* Matrix representing new rotation. */
18183        s = sin(psi);
18184        c = cos(psi);
18185        jauIr(a);
18186        a[0][0] =  c;
18187        a[1][0] = -s;
18188        a[0][1] =  s;
18189        a[1][1] =  c;
18190 
18191     /* Rotate. */
18192        w = jauRxr(a, r);
18193 
18194     /* Return result. */
18195        jauCr(w, r);
18196 
18197        return;
18198 
18199         }
18200     
18201 
18202     /**
18203     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18204     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18205     *  coordinates.  Compatible with IAU 2000A precession-nutation.
18206     *
18207     *<p>This function is derived from the International Astronomical Union's
18208     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18209     *
18210     *<p>Status:  canonical model.
18211     *
18212     *<!-- Given: -->
18213     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18214     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18215     *     @param x double     CIP coordinates (Note 3)
18216     *     @param y double     CIP coordinates (Note 3) 
18217     *
18218     * <!-- Returned (function value): -->
18219     *  @return double    the CIO locator s in radians (Note 2)
18220     *
18221     * <p>Notes:
18222     * <ol>
18223     *
18224     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18225     *     convenient way between the two arguments.  For example,
18226     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18227     *     among others:
18228     *<pre>
18229     *            date1          date2
18230     *
18231     *         2450123.7           0.0       (JD method)
18232     *         2451545.0       -1421.3       (J2000 method)
18233     *         2400000.5       50123.2       (MJD method)
18234     *         2450123.5           0.2       (date &amp; time method)
18235     *</pre>
18236     *     The JD method is the most natural and convenient to use in
18237     *     cases where the loss of several decimal digits of resolution
18238     *     is acceptable.  The J2000 method is best matched to the way
18239     *     the argument is handled internally and will deliver the
18240     *     optimum resolution.  The MJD method and the date &amp; time methods
18241     *     are both good compromises between resolution and convenience.
18242     *
18243     * <li> The CIO locator s is the difference between the right ascensions
18244     *     of the same point in two systems:  the two systems are the GCRS
18245     *     and the CIP,CIO, and the point is the ascending node of the
18246     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18247     *     throughout 1900-2100.
18248     *
18249     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18250     *     are the x and y components of the CIP unit vector;  this series
18251     *     is more compact than a direct series for s would be.  This
18252     *     function requires X,Y to be supplied by the caller, who is
18253     *     responsible for providing values that are consistent with the
18254     *     supplied date.
18255     *
18256     * <li> The model is consistent with the IAU 2000A precession-nutation.
18257     *</ol>
18258     *<p>Called:<ul>
18259     *     <li>{@link #jauFal03} mean anomaly of the Moon
18260     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18261     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18262     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18263     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18264     *     <li>{@link #jauFave03} mean longitude of Venus
18265     *     <li>{@link #jauFae03} mean longitude of Earth
18266     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18267     * </ul>
18268     *<p>References:
18269     *
18270     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18271     *     "Expressions for the Celestial Intermediate Pole and Celestial
18272     *     Ephemeris Origin consistent with the IAU 2000A precession-
18273     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18274     *
18275     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18276     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18277     *
18278     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18279     *     IERS Technical Note No. 32, BKG (2004)
18280     *
18281     *@version 2010 January 18
18282     *
18283     *  @since Release 20101201
18284     *
18285     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18286     */
18287     public static double jauS00(double date1, double date2, double x, double y)
18288     {
18289     /* Time since J2000.0, in Julian centuries */
18290        double t;
18291 
18292     /* Miscellaneous */
18293        int i, j;
18294        double a, w0, w1, w2, w3, w4, w5;
18295 
18296     /* Fundamental arguments */
18297        double fa[] = new double[8];
18298 
18299     /* Returned value */
18300        double s;
18301 
18302     /* --------------------- */
18303     /* The series for s+XY/2 */
18304     /* --------------------- */
18305 
18306     /* Polynomial coefficients */
18307        final double sp[] = {
18308 
18309        /* 1-6 */
18310               94.00e-6,
18311             3808.35e-6,
18312             -119.94e-6,
18313           -72574.09e-6,
18314               27.70e-6,
18315               15.61e-6
18316        };
18317 
18318     /* Terms of order t^0 */
18319        final TERM s0[] = {
18320 
18321        /* 1-10 */
18322           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18323           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18324           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18325           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18326           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18327           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18328           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18329           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18330           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18331           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18332 
18333        /* 11-20 */
18334           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18335           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18336           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18337           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18338           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18339           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18340           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18341           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18342           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18343           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18344 
18345        /* 21-30 */
18346           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18347           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18348           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18349           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18350           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18351           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18352           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18353           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18354           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18355           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18356 
18357        /* 31-33 */
18358           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18359           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18360           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18361        };
18362 
18363     /* Terms of order t^1 */
18364        final TERM s1[] ={
18365 
18366        /* 1-3 */
18367           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18368           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.71e-6,  -0.03e-6 ),
18369           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18370        };
18371 
18372     /* Terms of order t^2 */
18373        final TERM s2[] ={
18374 
18375        /* 1-10 */
18376           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.53e-6,  -0.17e-6 ),
18377           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18378           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18379           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18380           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18381           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18382           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18383           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18384           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18385           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18386 
18387        /* 11-20 */
18388           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18389           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18390           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18391           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18392           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18393           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18394           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
18395           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
18396           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
18397           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
18398 
18399        /* 21-25 */
18400           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
18401           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
18402           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18403           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
18404           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18405        };
18406 
18407     /* Terms of order t^3 */
18408        final TERM s3[] ={
18409 
18410        /* 1-4 */
18411           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.51e-6 ),
18412           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.39e-6 ),
18413           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.24e-6 ),
18414           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.22e-6 )
18415        };
18416 
18417     /* Terms of order t^4 */
18418        final TERM s4[] ={
18419 
18420        /* 1-1 */
18421           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
18422        };
18423 
18424     /* Number of terms in the series */
18425        final int NS0 = s0.length;
18426        final int NS1 = s1.length;
18427        final int NS2 = s2.length;
18428        final int NS3 = s3.length;
18429        final int NS4 = s4.length;
18430 
18431     /*--------------------------------------------------------------------*/
18432 
18433     /* Interval between fundamental epoch J2000.0 and current date (JC). */
18434        t = ((date1 - DJ00) + date2) / DJC;
18435 
18436     /* Fundamental Arguments (from IERS Conventions 2003) */
18437 
18438     /* Mean anomaly of the Moon. */
18439        fa[0] = jauFal03(t);
18440 
18441     /* Mean anomaly of the Sun. */
18442        fa[1] = jauFalp03(t);
18443 
18444     /* Mean longitude of the Moon minus that of the ascending node. */
18445        fa[2] = jauFaf03(t);
18446 
18447     /* Mean elongation of the Moon from the Sun. */
18448        fa[3] = jauFad03(t);
18449 
18450     /* Mean longitude of the ascending node of the Moon. */
18451        fa[4] = jauFaom03(t);
18452 
18453     /* Mean longitude of Venus. */
18454        fa[5] = jauFave03(t);
18455 
18456     /* Mean longitude of Earth. */
18457        fa[6] = jauFae03(t);
18458 
18459     /* General precession in longitude. */
18460        fa[7] = jauFapa03(t);
18461 
18462     /* Evaluate s. */
18463        w0 = sp[0];
18464        w1 = sp[1];
18465        w2 = sp[2];
18466        w3 = sp[3];
18467        w4 = sp[4];
18468        w5 = sp[5];
18469 
18470        for (i = NS0-1; i >= 0; i--) {
18471        a = 0.0;
18472        for (j = 0; j < 8; j++) {
18473            a += (double)s0[i].nfa[j] * fa[j];
18474        }
18475        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
18476        }
18477 
18478        for (i = NS1-1; i >= 0; i--) {
18479        a = 0.0;
18480        for (j = 0; j < 8; j++) {
18481            a += (double)s1[i].nfa[j] * fa[j];
18482        }
18483        w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
18484        }
18485 
18486        for (i = NS2-1; i >= 0; i--) {
18487        a = 0.0;
18488        for (j = 0; j < 8; j++) {
18489            a += (double)s2[i].nfa[j] * fa[j];
18490        }
18491        w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
18492        }
18493 
18494        for (i = NS3-1; i >= 0; i--) {
18495        a = 0.0;
18496        for (j = 0; j < 8; j++) {
18497            a += (double)s3[i].nfa[j] * fa[j];
18498        }
18499        w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
18500        }
18501 
18502        for (i = NS4-1; i >= 0; i--) {
18503        a = 0.0;
18504        for (j = 0; j < 8; j++) {
18505            a += (double)s4[i].nfa[j] * fa[j];
18506        }
18507        w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
18508        }
18509 
18510        s = (w0 +
18511            (w1 +
18512            (w2 +
18513            (w3 +
18514            (w4 +
18515             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
18516 
18517        return s;
18518 
18519         }
18520     
18521 
18522     /**
18523     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18524     *  the equator of the Celestial Intermediate Pole, using the IAU 2000A
18525     *  precession-nutation model.
18526     *
18527     *<p>This function is derived from the International Astronomical Union's
18528     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18529     *
18530     *<p>Status:  support function.
18531     *
18532     *<!-- Given: -->
18533     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18534     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18535     *
18536     * <!-- Returned (function value): -->
18537     *  @return double    the CIO locator s in radians (Note 2)
18538     *
18539     * <p>Notes:
18540     * <ol>
18541     *
18542     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18543     *     convenient way between the two arguments.  For example,
18544     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18545     *     among others:
18546     *<pre>
18547     *            date1          date2
18548     *
18549     *         2450123.7           0.0       (JD method)
18550     *         2451545.0       -1421.3       (J2000 method)
18551     *         2400000.5       50123.2       (MJD method)
18552     *         2450123.5           0.2       (date &amp; time method)
18553     *</pre>
18554     *     The JD method is the most natural and convenient to use in
18555     *     cases where the loss of several decimal digits of resolution
18556     *     is acceptable.  The J2000 method is best matched to the way
18557     *     the argument is handled internally and will deliver the
18558     *     optimum resolution.  The MJD method and the date &amp; time methods
18559     *     are both good compromises between resolution and convenience.
18560     *
18561     * <li> The CIO locator s is the difference between the right ascensions
18562     *     of the same point in two systems.  The two systems are the GCRS
18563     *     and the CIP,CIO, and the point is the ascending node of the
18564     *     CIP equator.  The CIO locator s remains a small fraction of
18565     *     1 arcsecond throughout 1900-2100.
18566     *
18567     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18568     *     are the x and y components of the CIP unit vector;  this series
18569     *     is more compact than a direct series for s would be.  The present
18570     *     function uses the full IAU 2000A nutation model when predicting
18571     *     the CIP position.  Faster results, with no significant loss of
18572     *     accuracy, can be obtained via the function jauS00b, which uses
18573     *     instead the IAU 2000B truncated model.
18574     *</ol>
18575     *<p>Called:<ul>
18576     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
18577     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18578     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18579     * </ul>
18580     *<p>References:
18581     *
18582     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18583     *     "Expressions for the Celestial Intermediate Pole and Celestial
18584     *     Ephemeris Origin consistent with the IAU 2000A precession-
18585     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18586     *
18587     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18588     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18589     *
18590     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18591     *     IERS Technical Note No. 32, BKG (2004)
18592     *
18593     *@version 2010 January 18
18594     *
18595     *  @since Release 20101201
18596     *
18597     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18598     */
18599     public static double jauS00a(double date1, double date2)
18600     {
18601        double s;
18602 
18603 
18604     /* Bias-precession-nutation-matrix, IAU 2000A. */
18605        double rbpn[][] = jauPnm00a(date1, date2);
18606 
18607     /* Extract the CIP coordinates. */
18608        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18609 
18610     /* Compute the CIO locator s, given the CIP coordinates. */
18611        s = jauS00(date1, date2, cip.x, cip.y);
18612 
18613        return s;
18614 
18615         }
18616     
18617 
18618     /**
18619     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18620     *  the equator of the Celestial Intermediate Pole, using the IAU 2000B
18621     *  precession-nutation model.
18622     *
18623     *<p>This function is derived from the International Astronomical Union's
18624     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18625     *
18626     *<p>Status:  support function.
18627     *
18628     *<!-- Given: -->
18629     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18630     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18631     *
18632     * <!-- Returned (function value): -->
18633     *  @return double    the CIO locator s in radians (Note 2)
18634     *
18635     * <p>Notes:
18636     * <ol>
18637     *
18638     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18639     *     convenient way between the two arguments.  For example,
18640     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18641     *     among others:
18642     *<pre>
18643     *            date1          date2
18644     *
18645     *         2450123.7           0.0       (JD method)
18646     *         2451545.0       -1421.3       (J2000 method)
18647     *         2400000.5       50123.2       (MJD method)
18648     *         2450123.5           0.2       (date &amp; time method)
18649     *</pre>
18650     *     The JD method is the most natural and convenient to use in
18651     *     cases where the loss of several decimal digits of resolution
18652     *     is acceptable.  The J2000 method is best matched to the way
18653     *     the argument is handled internally and will deliver the
18654     *     optimum resolution.  The MJD method and the date &amp; time methods
18655     *     are both good compromises between resolution and convenience.
18656     *
18657     * <li> The CIO locator s is the difference between the right ascensions
18658     *     of the same point in two systems.  The two systems are the GCRS
18659     *     and the CIP,CIO, and the point is the ascending node of the
18660     *     CIP equator.  The CIO locator s remains a small fraction of
18661     *     1 arcsecond throughout 1900-2100.
18662     *
18663     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18664     *     are the x and y components of the CIP unit vector;  this series
18665     *     is more compact than a direct series for s would be.  The present
18666     *     function uses the IAU 2000B truncated nutation model when
18667     *     predicting the CIP position.  The function jauS00a uses instead
18668     *     the full IAU 2000A model, but with no significant increase in
18669     *     accuracy and at some cost in speed.
18670     *</ol>
18671     *<p>Called:<ul>
18672     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
18673     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18674     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18675     * </ul>
18676     *<p>References:
18677     *
18678     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18679     *     "Expressions for the Celestial Intermediate Pole and Celestial
18680     *     Ephemeris Origin consistent with the IAU 2000A precession-
18681     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18682     *
18683     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18684     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18685     *
18686     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18687     *     IERS Technical Note No. 32, BKG (2004)
18688     *
18689     *@version 2010 January 18
18690     *
18691     *  @since Release 20101201
18692     *
18693     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18694     */
18695     public static double jauS00b(double date1, double date2)
18696     {
18697        double rbpn[][] = new double[3][3], s;
18698 
18699 
18700     /* Bias-precession-nutation-matrix, IAU 2000B. */
18701        rbpn = jauPnm00b(date1, date2);
18702 
18703     /* Extract the CIP coordinates. */
18704        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18705 
18706     /* Compute the CIO locator s, given the CIP coordinates. */
18707        s = jauS00(date1, date2, cip.x, cip.y);
18708 
18709        return s;
18710 
18711         }
18712     
18713 
18714     /**
18715     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18716     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18717     *  coordinates.  Compatible with IAU 2006/2000A precession-nutation.
18718     *
18719     *<p>This function is derived from the International Astronomical Union's
18720     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18721     *
18722     *<p>Status:  canonical model.
18723     *
18724     *<!-- Given: -->
18725     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18726     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18727     *     @param x double     CIP coordinates (Note 3)
18728     *     @param y double     CIP coordinates (Note 3) 
18729     *
18730     * <!-- Returned (function value): -->
18731     *  @return double    the CIO locator s in radians (Note 2)
18732     *
18733     * <p>Notes:
18734     * <ol>
18735     *
18736     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18737     *     convenient way between the two arguments.  For example,
18738     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18739     *     among others:
18740     *<pre>
18741     *            date1          date2
18742     *
18743     *         2450123.7           0.0       (JD method)
18744     *         2451545.0       -1421.3       (J2000 method)
18745     *         2400000.5       50123.2       (MJD method)
18746     *         2450123.5           0.2       (date &amp; time method)
18747     *</pre>
18748     *     The JD method is the most natural and convenient to use in
18749     *     cases where the loss of several decimal digits of resolution
18750     *     is acceptable.  The J2000 method is best matched to the way
18751     *     the argument is handled internally and will deliver the
18752     *     optimum resolution.  The MJD method and the date &amp; time methods
18753     *     are both good compromises between resolution and convenience.
18754     *
18755     * <li> The CIO locator s is the difference between the right ascensions
18756     *     of the same point in two systems:  the two systems are the GCRS
18757     *     and the CIP,CIO, and the point is the ascending node of the
18758     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18759     *     throughout 1900-2100.
18760     *
18761     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18762     *     are the x and y components of the CIP unit vector;  this series
18763     *     is more compact than a direct series for s would be.  This
18764     *     function requires X,Y to be supplied by the caller, who is
18765     *     responsible for providing values that are consistent with the
18766     *     supplied date.
18767     *
18768     * <li> The model is consistent with the "P03" precession (Capitaine et
18769     *     al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the
18770     *     IAU 2000A nutation (with P03 adjustments).
18771     *</ol>
18772     *<p>Called:<ul>
18773     *     <li>{@link #jauFal03} mean anomaly of the Moon
18774     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18775     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18776     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18777     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18778     *     <li>{@link #jauFave03} mean longitude of Venus
18779     *     <li>{@link #jauFae03} mean longitude of Earth
18780     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18781     * </ul>
18782     *<p>References:
18783     *
18784     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003, Astron.
18785     *     Astrophys. 432, 355
18786     *
18787     *     <p>McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003),
18788     *     IERS Technical Note No. 32, BKG
18789     *
18790     *@version 2009 December 17
18791     *
18792     *  @since Release 20101201
18793     *
18794     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18795     */
18796     public static double jauS06(double date1, double date2, double x, double y)
18797     {
18798     /* Time since J2000.0, in Julian centuries */
18799        double t;
18800 
18801     /* Miscellaneous */
18802        int i, j;
18803        double a, w0, w1, w2, w3, w4, w5;
18804 
18805     /* Fundamental arguments */
18806        double fa[] = new double[8];
18807 
18808     /* Returned value */
18809        double s;
18810 
18811     /* --------------------- */
18812     /* The series for s+XY/2 */
18813     /* --------------------- */
18814 
18815     /* Polynomial coefficients */
18816        final double sp[] = {
18817 
18818        /* 1-6 */
18819               94.00e-6,
18820             3808.65e-6,
18821             -122.68e-6,
18822           -72574.11e-6,
18823               27.98e-6,
18824               15.62e-6
18825        };
18826 
18827     /* Terms of order t^0 */
18828        final TERM s0[] = {
18829 
18830        /* 1-10 */
18831           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18832           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18833           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18834           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18835           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18836           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18837           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18838           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18839           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18840           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18841 
18842        /* 11-20 */
18843           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18844           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18845           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18846           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18847           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18848           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18849           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18850           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18851           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18852           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18853 
18854        /* 21-30 */
18855           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18856           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18857           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18858           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18859           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18860           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18861           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18862           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18863           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18864           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18865 
18866        /* 31-33 */
18867           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18868           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18869           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18870        };
18871 
18872     /* Terms of order t^1 */
18873        final TERM s1[] = {
18874 
18875        /* 1 - 3 */
18876           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18877           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.73e-6,  -0.03e-6 ),
18878           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18879        };
18880 
18881     /* Terms of order t^2 */
18882        final TERM s2[] = {
18883 
18884        /* 1-10 */
18885           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.52e-6,  -0.17e-6 ),
18886           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18887           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18888           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18889           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18890           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18891           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18892           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18893           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18894           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18895 
18896        /* 11-20 */
18897           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18898           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18899           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18900           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18901           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18902           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18903           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
18904           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
18905           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
18906           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
18907 
18908        /* 21-25 */
18909           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
18910           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
18911           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18912           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
18913           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18914        };
18915 
18916     /* Terms of order t^3 */
18917        final TERM s3[] = {
18918 
18919        /* 1-4 */
18920           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.42e-6 ),
18921           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.46e-6 ),
18922           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.25e-6 ),
18923           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.23e-6 )
18924        };
18925 
18926     /* Terms of order t^4 */
18927        final TERM s4[] = {
18928 
18929        /* 1-1 */
18930           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
18931        };
18932 
18933     /* Number of terms in the series */
18934        final int NS0 = s0.length;
18935        final int NS1 = s1.length;
18936        final int NS2 = s2.length;
18937        final int NS3 = s3.length;
18938        final int NS4 = s4.length;
18939 
18940     /*--------------------------------------------------------------------*/
18941 
18942     /* Interval between fundamental epoch J2000.0 and current date (JC). */
18943        t = ((date1 - DJ00) + date2) / DJC;
18944 
18945     /* Fundamental Arguments (from IERS Conventions 2003) */
18946 
18947     /* Mean anomaly of the Moon. */
18948        fa[0] = jauFal03(t);
18949 
18950     /* Mean anomaly of the Sun. */
18951        fa[1] = jauFalp03(t);
18952 
18953     /* Mean longitude of the Moon minus that of the ascending node. */
18954        fa[2] = jauFaf03(t);
18955 
18956     /* Mean elongation of the Moon from the Sun. */
18957        fa[3] = jauFad03(t);
18958 
18959     /* Mean longitude of the ascending node of the Moon. */
18960        fa[4] = jauFaom03(t);
18961 
18962     /* Mean longitude of Venus. */
18963        fa[5] = jauFave03(t);
18964 
18965     /* Mean longitude of Earth. */
18966        fa[6] = jauFae03(t);
18967 
18968     /* General precession in longitude. */
18969        fa[7] = jauFapa03(t);
18970 
18971     /* Evaluate s. */
18972        w0 = sp[0];
18973        w1 = sp[1];
18974        w2 = sp[2];
18975        w3 = sp[3];
18976        w4 = sp[4];
18977        w5 = sp[5];
18978 
18979        for (i = NS0-1; i >= 0; i--) {
18980        a = 0.0;
18981        for (j = 0; j < 8; j++) {
18982           a += (double)s0[i].nfa[j] * fa[j];
18983        }
18984        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
18985        }
18986 
18987        for (i = NS1-1; i >= 0; i--) {
18988           a = 0.0;
18989           for (j = 0; j < 8; j++) {
18990              a += (double)s1[i].nfa[j] * fa[j];
18991           }
18992           w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
18993        }
18994 
18995        for (i = NS2-1; i >= 0; i--) {
18996           a = 0.0;
18997           for (j = 0; j < 8; j++) {
18998              a += (double)s2[i].nfa[j] * fa[j];
18999           }
19000           w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
19001        }
19002 
19003        for (i = NS3-1; i >= 0; i--) {
19004           a = 0.0;
19005           for (j = 0; j < 8; j++) {
19006              a += (double)s3[i].nfa[j] * fa[j];
19007           }
19008           w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
19009        }
19010 
19011        for (i = NS4-1; i >= 0; i--) {
19012           a = 0.0;
19013           for (j = 0; j < 8; j++) {
19014              a += (double)s4[i].nfa[j] * fa[j];
19015           }
19016           w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
19017        }
19018 
19019        s = (w0 +
19020            (w1 +
19021            (w2 +
19022            (w3 +
19023            (w4 +
19024             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
19025 
19026        return s;
19027 
19028         }
19029     
19030 
19031     /**
19032     *  The CIO locator s, positioning the Celestial Intermediate Origin on
19033     *  the equator of the Celestial Intermediate Pole, using the IAU 2006
19034     *  precession and IAU 2000A nutation models.
19035     *
19036     *<p>This function is derived from the International Astronomical Union's
19037     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19038     *
19039     *<p>Status:  support function.
19040     *
19041     *<!-- Given: -->
19042     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19043     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19044     *
19045     * <!-- Returned (function value): -->
19046     *  @return double    the CIO locator s in radians (Note 2)
19047     *
19048     * <p>Notes:
19049     * <ol>
19050     *
19051     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19052     *     convenient way between the two arguments.  For example,
19053     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19054     *     among others:
19055     *<pre>
19056     *            date1          date2
19057     *
19058     *         2450123.7           0.0       (JD method)
19059     *         2451545.0       -1421.3       (J2000 method)
19060     *         2400000.5       50123.2       (MJD method)
19061     *         2450123.5           0.2       (date &amp; time method)
19062     *</pre>
19063     *     The JD method is the most natural and convenient to use in
19064     *     cases where the loss of several decimal digits of resolution
19065     *     is acceptable.  The J2000 method is best matched to the way
19066     *     the argument is handled internally and will deliver the
19067     *     optimum resolution.  The MJD method and the date &amp; time methods
19068     *     are both good compromises between resolution and convenience.
19069     *
19070     * <li> The CIO locator s is the difference between the right ascensions
19071     *     of the same point in two systems.  The two systems are the GCRS
19072     *     and the CIP,CIO, and the point is the ascending node of the
19073     *     CIP equator.  The CIO locator s remains a small fraction of
19074     *     1 arcsecond throughout 1900-2100.
19075     *
19076     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
19077     *     are the x and y components of the CIP unit vector;  this series is
19078     *     more compact than a direct series for s would be.  The present
19079     *     function uses the full IAU 2000A nutation model when predicting
19080     *     the CIP position.
19081     *</ol>
19082     *<p>Called:<ul>
19083     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
19084     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
19085     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
19086     * </ul>
19087     *<p>References:
19088     *
19089     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
19090     *     "Expressions for the Celestial Intermediate Pole and Celestial
19091     *     Ephemeris Origin consistent with the IAU 2000A precession-
19092     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
19093     *
19094     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
19095     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
19096     *
19097     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
19098     *
19099     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
19100     *     IERS Technical Note No. 32, BKG
19101     *
19102     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
19103     *
19104     *@version 2010 January 18
19105     *
19106     *  @since Release 20101201
19107     *
19108     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19109     */
19110     public static double jauS06a(double date1, double date2)
19111     {
19112        double rnpb[][] = new double[3][3], s;
19113 
19114 
19115     /* Bias-precession-nutation-matrix, IAU 20006/2000A. */
19116        rnpb = jauPnm06a(date1, date2);
19117 
19118     /* Extract the CIP coordinates. */
19119        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
19120 
19121     /* Compute the CIO locator s, given the CIP coordinates. */
19122        s = jauS06(date1, date2, cip.x, cip.y);
19123 
19124        return s;
19125 
19126         }
19127     
19128 
19129     /**
19130     *  Convert spherical coordinates to Cartesian.
19131     *
19132     *<p>This function is derived from the International Astronomical Union's
19133     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19134     *
19135     *<p>Status:  vector/matrix support function.
19136     *
19137     *<!-- Given: -->
19138     *     @param theta     double        longitude angle (radians)
19139     *     @param phi       double        latitude angle (radians)
19140     *
19141     *<!-- Returned: -->
19142     *     @return c         double[3]      <u>returned</u> direction cosines
19143     *
19144     *@version 2008 October 28
19145     *
19146     *  @since Release 20101201
19147     *
19148     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19149     */
19150     public static double[] jauS2c(double theta, double phi )
19151     {
19152        double cp, c[] = new double[3];
19153 
19154 
19155        cp = cos(phi);
19156        c[0] = cos(theta) * cp;
19157        c[1] = sin(theta) * cp;
19158        c[2] = sin(phi);
19159 
19160        return c;
19161 
19162         }
19163     
19164 
19165     /**
19166     *  Convert spherical polar coordinates to p-vector.
19167     *
19168     *<p>This function is derived from the International Astronomical Union's
19169     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19170     *
19171     *<p>Status:  vector/matrix support function.
19172     *
19173     *<!-- Given: -->
19174     *     @param theta    double        longitude angle (radians)
19175     *     @param phi      double        latitude angle (radians)
19176     *     @param r        double        radial distance
19177     *
19178     *<!-- Returned: -->
19179     *     @return p        double[3]      <u>returned</u> Cartesian coordinates
19180     *
19181     *<p>Called:<ul>
19182     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19183     *     <li>{@link #jauSxp} multiply p-vector by scalar
19184     * </ul>
19185     *@version 2008 May 11
19186     *
19187     *  @since Release 20101201
19188     *
19189     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19190     */
19191     public static double[] jauS2p(double theta, double phi, double r )
19192     {
19193        double p[];
19194        double u[] = new double[3];
19195 
19196 
19197        u = jauS2c(theta,phi);
19198        p = jauSxp(r,u);
19199 
19200        return p;
19201 
19202         }
19203     
19204 
19205     /**
19206     *  Convert position/velocity from spherical to Cartesian coordinates.
19207     *
19208     *<p>This function is derived from the International Astronomical Union's
19209     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19210     *
19211     *<p>Status:  vector/matrix support function.
19212     *
19213     *<!-- Given: -->
19214     *     @param theta     double           longitude angle (radians)
19215     *     @param phi       double           latitude angle (radians)
19216     *     @param r         double           radial distance
19217     *     @param td        double           rate of change of theta
19218     *     @param pd        double           rate of change of phi
19219     *     @param rd        double           rate of change of r
19220     *
19221     *<!-- Returned: -->
19222     *     @return pv        double[2][3]      <u>returned</u> pv-vector
19223     *
19224     *@version 2008 May 25
19225     *
19226     *  @since Release 20101201
19227     *
19228     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19229     */
19230     public static double[][] jauS2pv(double theta, double phi, double r,
19231                  double td, double pd, double rd)
19232     {
19233        double pv[][] = new double[2][3];
19234        double st, ct, sp, cp, rcp, x, y, rpd, w;
19235 
19236 
19237        st = sin(theta);
19238        ct = cos(theta);
19239        sp = sin(phi);
19240        cp = cos(phi);
19241        rcp = r * cp;
19242        x = rcp * ct;
19243        y = rcp * st;
19244        rpd = r * pd;
19245        w = rpd*sp - cp*rd;
19246 
19247        pv[0][0] = x;
19248        pv[0][1] = y;
19249        pv[0][2] = r * sp;
19250        pv[1][0] = -y*td - w*ct;
19251        pv[1][1] =  x*td - w*st;
19252        pv[1][2] = rpd*cp + sp*rd;
19253 
19254        return pv;
19255 
19256         }
19257     
19258 
19259     /**
19260     *  Multiply a pv-vector by two scalars.
19261     *
19262     *<p>This function is derived from the International Astronomical Union's
19263     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19264     *
19265     *<p>Status:  vector/matrix support function.
19266     *
19267     *<!-- Given: -->
19268     *     @param s1      double          scalar to multiply position component by
19269     *     @param s2      double          scalar to multiply velocity component by
19270     *     @param pv      double[2][3]    pv-vector
19271     *
19272     *<!-- Returned: -->
19273     *     @return spv     double[2][3]     <u>returned</u> pv-vector: p scaled by s1, v scaled by s2
19274     *
19275     *  Note:
19276     *     It is permissible for pv and spv to be the same array.
19277     *
19278     *<p>Called:<ul>
19279     *     <li>{@link #jauSxp} multiply p-vector by scalar
19280     * </ul>
19281     *@version 2008 October 28
19282     *
19283     *  @since Release 20101201
19284     *
19285     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19286     */
19287     public static double[][] jauS2xpv(double s1, double s2, double pv[][])
19288     {
19289         double spv[][] = new double[2][3];
19290         spv[0] = jauSxp(s1, pv[0]);
19291         spv[1] =jauSxp(s2, pv[1]);
19292 
19293        return spv;
19294 
19295         }
19296     
19297 
19298     /**
19299     *  Angular separation between two p-vectors.
19300     *
19301     *<p>This function is derived from the International Astronomical Union's
19302     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19303     *
19304     *<p>Status:  vector/matrix support function.
19305     *
19306     *<!-- Given: -->
19307     *     @param a       double[3]     first p-vector (not necessarily unit length)
19308     *     @param b       double[3]     second p-vector (not necessarily unit length)
19309     *
19310     * <!-- Returned (function value): -->
19311     *  @return double       angular separation (radians, always positive)
19312     *
19313     * <p>Notes:
19314     * <ol>
19315     *
19316     * <li> If either vector is null, a zero result is returned.
19317     *
19318     * <li> The angular separation is most simply formulated in terms of
19319     *     scalar product.  However, this gives poor accuracy for angles
19320     *     near zero and pi.  The present algorithm uses both cross product
19321     *     and dot product, to deliver full accuracy whatever the size of
19322     *     the angle.
19323     *</ol>
19324     *<p>Called:<ul>
19325     *     <li>{@link #jauPxp} vector product of two p-vectors
19326     *     <li>{@link #jauPm} modulus of p-vector
19327     *     <li>{@link #jauPdp} scalar product of two p-vectors
19328     * </ul>
19329     *@version 2008 May 22
19330     *
19331     *  @since Release 20101201
19332     *
19333     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19334     */
19335     public static double jauSepp(double a[] , double b[] )
19336     {
19337        double axb[] = new double[3], ss, cs, s;
19338 
19339 
19340     /* Sine of angle between the vectors, multiplied by the two moduli. */
19341        axb = jauPxp(a,b);
19342        ss = jauPm(axb);
19343 
19344     /* Cosine of the angle, multiplied by the two moduli. */
19345        cs = jauPdp(a, b);
19346 
19347     /* The angle. */
19348        s = ((ss != 0.0) || (cs != 0.0)) ? atan2(ss, cs) : 0.0;
19349 
19350        return s;
19351 
19352         }
19353     
19354 
19355     /**
19356     *  Angular separation between two sets of spherical coordinates.
19357     *
19358     *<p>This function is derived from the International Astronomical Union's
19359     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19360     *
19361     *<p>Status:  vector/matrix support function.
19362     *
19363     *<!-- Given: -->
19364     *     @param al      double        first longitude (radians)
19365     *     @param ap      double        first latitude (radians)
19366     *     @param bl      double        second longitude (radians)
19367     *     @param bp      double        second latitude (radians)
19368     *
19369     * <!-- Returned (function value): -->
19370     *  @return double       angular separation (radians)
19371     *
19372     *<p>Called:<ul>
19373     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19374     *     <li>{@link #jauSepp} angular separation between two p-vectors
19375     * </ul>
19376     *@version 2008 May 16
19377     *
19378     *  @since Release 20101201
19379     *
19380     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19381     */
19382     public static double jauSeps(double al, double ap, double bl, double bp)
19383     {
19384        double ac[] = new double[3], bc[] = new double[3], s;
19385 
19386 
19387     /* Spherical to Cartesian. */
19388        ac = jauS2c(al,ap);
19389        bc = jauS2c(bl,bp);
19390 
19391     /* Angle between the vectors. */
19392        s = jauSepp(ac, bc);
19393 
19394        return s;
19395 
19396         }
19397     
19398 
19399     /**
19400     *  The TIO locator s', positioning the Terrestrial Intermediate Origin
19401     *  on the equator of the Celestial Intermediate Pole.
19402     *
19403     *<p>This function is derived from the International Astronomical Union's
19404     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19405     *
19406     *<p>Status:  canonical model.
19407     *
19408     *<!-- Given: -->
19409     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19410     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19411     *
19412     * <!-- Returned (function value): -->
19413     *  @return double    the TIO locator s' in radians (Note 2)
19414     *
19415     * <p>Notes:
19416     * <ol>
19417     *
19418     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19419     *     convenient way between the two arguments.  For example,
19420     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19421     *     among others:
19422     *<pre>
19423     *            date1          date2
19424     *
19425     *         2450123.7           0.0       (JD method)
19426     *         2451545.0       -1421.3       (J2000 method)
19427     *         2400000.5       50123.2       (MJD method)
19428     *         2450123.5           0.2       (date &amp; time method)
19429     *</pre>
19430     *     The JD method is the most natural and convenient to use in
19431     *     cases where the loss of several decimal digits of resolution
19432     *     is acceptable.  The J2000 method is best matched to the way
19433     *     the argument is handled internally and will deliver the
19434     *     optimum resolution.  The MJD method and the date &amp; time methods
19435     *     are both good compromises between resolution and convenience.
19436     *
19437     * <li> The TIO locator s' is obtained from polar motion observations by
19438     *     numerical integration, and so is in essence unpredictable.
19439     *     However, it is dominated by a secular drift of about
19440     *     47 microarcseconds per century, which is the approximation
19441     *     evaluated by the present function.
19442     *</ol>
19443     *<p>Reference:
19444     *
19445     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
19446     *     IERS Technical Note No. 32, BKG (2004)
19447     *
19448     *@version 2008 May 24
19449     *
19450     *  @since Release 20101201
19451     *
19452     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19453     */
19454     public static double jauSp00(double date1, double date2)
19455     {
19456        double t, sp;
19457 
19458 
19459     /* Interval between fundamental epoch J2000.0 and current date (JC). */
19460        t = ((date1 - DJ00) + date2) / DJC;
19461 
19462     /* Approximate s'. */
19463        sp = -47e-6 * t * DAS2R;
19464 
19465        return sp;
19466 
19467         }
19468     
19469 
19470     /**
19471     *  Star proper motion:  update star catalog data for space motion.
19472     *
19473     *<p>This function is derived from the International Astronomical Union's
19474     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19475     *
19476     *<p>Status:  support function.
19477     *
19478     *<!-- Given: -->
19479     *     @param ra1     double      right ascension (radians), before
19480     *     @param dec1    double      declination (radians), before
19481     *     @param pmr1    double      RA proper motion (radians/year), before
19482     *     @param pmd1    double      Dec proper motion (radians/year), before
19483     *     @param px1     double      parallax (arcseconds), before
19484     *     @param rv1     double      radial velocity (km/s, +ve = receding), before
19485     *     @param ep1a    double      "before" epoch, part A (Note 1)
19486     *     @param ep1b    double      "before" epoch, part B (Note 1)
19487     *     @param ep2a    double      "after" epoch, part A (Note 1)
19488     *     @param ep2b    double      "after" epoch, part B (Note 1)
19489     *
19490     *<!-- Returned: -->
19491     *     @return ra2     double       <u>returned</u> right ascension (radians), after
19492     *             dec2    double       <u>returned</u> declination (radians), after
19493     *             pmr2    double       <u>returned</u> RA proper motion (radians/year), after
19494     *             pmd2    double       <u>returned</u> Dec proper motion (radians/year), after
19495     *             px2     double       <u>returned</u> parallax (arcseconds), after
19496     *             rv2     double       <u>returned</u> radial velocity (km/s, +ve = receding), after
19497     *
19498     * <!-- Returned (function value): -->
19499     *  @return int        status:
19500     *                          -1 = system error (should not occur)
19501     *                           0 = no warnings or errors
19502     *                           1 = distance overridden (Note 6)
19503     *                           2 = excessive velocity (Note 7)
19504     *                           4 = solution didn't converge (Note 8)
19505     *                        else = binary logical OR of the above warnings
19506     *FIXME need to return the status as well.
19507     * <p>Notes:
19508     * <ol>
19509     *
19510     * <li> The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are
19511     *     Julian Dates, apportioned in any convenient way between the two
19512     *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
19513     *     expressed in any of these ways, among others:
19514     *<pre>
19515     *             epna          epnb
19516     *
19517     *         2450123.7           0.0       (JD method)
19518     *         2451545.0       -1421.3       (J2000 method)
19519     *         2400000.5       50123.2       (MJD method)
19520     *         2450123.5           0.2       (date &amp; time method)
19521     *</pre>
19522     *     The JD method is the most natural and convenient to use in
19523     *     cases where the loss of several decimal digits of resolution
19524     *     is acceptable.  The J2000 method is best matched to the way
19525     *     the argument is handled internally and will deliver the
19526     *     optimum resolution.  The MJD method and the date &amp; time methods
19527     *     are both good compromises between resolution and convenience.
19528     *
19529     * <li> In accordance with normal star-catalog conventions, the object's
19530     *     right ascension and declination are freed from the effects of
19531     *     secular aberration.  The frame, which is aligned to the catalog
19532     *     equator and equinox, is Lorentzian and centered on the SSB.
19533     *
19534     *     The proper motions are the rate of change of the right ascension
19535     *     and declination at the catalog epoch and are in radians per TDB
19536     *     Julian year.
19537     *
19538     *     The parallax and radial velocity are in the same frame.
19539     *
19540     * <li> Care is needed with units.  The star coordinates are in radians
19541     *     and the proper motions in radians per Julian year, but the
19542     *     parallax is in arcseconds.
19543     *
19544     * <li> The RA proper motion is in terms of coordinate angle, not true
19545     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19546     *     motions, the RA proper motion will need to be divided by cos(Dec)
19547     *     before use.
19548     *
19549     * <li> Straight-line motion at constant speed, in the inertial frame,
19550     *     is assumed.
19551     *
19552     * <li> An extremely small (or zero or negative) parallax is interpreted
19553     *     to mean that the object is on the "celestial sphere", the radius
19554     *     of which is an arbitrary (large) value (see the jauStarpv
19555     *     function for the value used).  When the distance is overridden in
19556     *     this way, the status, initially zero, has 1 added to it.
19557     *
19558     * <li> If the space velocity is a significant fraction of c (see the
19559     *     constant VMAX in the function jauStarpv),  it is arbitrarily set
19560     *     to zero.  When this action occurs, 2 is added to the status.
19561     *
19562     * <li> The relativistic adjustment carried out in the jauStarpv function
19563     *     involves an iterative calculation.  If the process fails to
19564     *     converge within a set number of iterations, 4 is added to the
19565     *     status.
19566     *</ol>
19567     *<p>Called:<ul>
19568     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
19569     *     <li>{@link #jauPvu} update a pv-vector
19570     *     <li>{@link #jauPdp} scalar product of two p-vectors
19571     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
19572     * </ul>
19573     *@version 2008 May 16
19574     *
19575     *  @since Release 20101201
19576     *
19577     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19578     */
19579     public static CatalogCoords jauStarpm(double ra1, double dec1,
19580                   double pmr1, double pmd1, double px1, double rv1,
19581                   double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
19582     {
19583        double pv1[][] = new double[2][3], tl1, dt, pv[][] = new double[2][3], r2, rdv, v2, c2mv2, tl2,
19584               pv2[][] = new double[2][3];
19585        jauStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
19586 
19587     /* Light time when observed (days). */
19588        tl1 = jauPm(pv1[0]) / DC;
19589 
19590     /* Time interval, "before" to "after" (days). */
19591        dt = (ep2a - ep1a) + (ep2b - ep1b);
19592 
19593     /* Move star along track from the "before" observed position to the */
19594     /* "after" geometric position. */
19595        pv = jauPvu(dt + tl1, pv1);
19596 
19597     /* From this geometric position, deduce the observed light time (days) */
19598     /* at the "after" epoch (with theoretically unneccessary error check). */
19599        r2 = jauPdp(pv[0], pv[0]);
19600        rdv = jauPdp(pv[0], pv[1]);
19601        v2 = jauPdp(pv[1], pv[1]);
19602        c2mv2 = DC*DC - v2;
19603        if (c2mv2 <=  0) throw new JSOFAInternalError("internal error", -1);
19604        tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
19605 
19606     /* Move the position along track from the observed place at the */
19607     /* "before" epoch to the observed place at the "after" epoch. */
19608        pv2 =jauPvu(dt + (tl1 - tl2), pv1 );
19609 
19610     /* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */
19611        CatalogCoords cat = jauPvstar(pv2);
19612 
19613        return cat;
19614 
19615         }
19616     
19617 
19618     /**
19619     *  Convert star catalog coordinates to position+velocity vector.
19620     *
19621     *<p>This function is derived from the International Astronomical Union's
19622     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19623     *
19624     *<p>Status:  support function.
19625     *
19626     *  Given (Note 1):
19627     *   @param  ra     double        right ascension (radians)
19628     *   @param  dec    double        declination (radians)
19629     *   @param  pmr    double        RA proper motion (radians/year)
19630     *   @param  pmd    double        Dec proper motion (radians/year)
19631     *   @param  px     double        parallax (arcseconds)
19632     *   @param  rv     double        radial velocity (km/s, positive = receding)
19633     *
19634     *  Returned (Note 2):
19635     *   @param  pv     double[2][3]  pv-vector (au, au/day)
19636     *
19637     * <!-- Returned (function value): -->
19638     *  @return int           status:
19639     *                              0 = no warnings
19640     *                              1 = distance overridden (Note 6)
19641     *                              2 = excessive speed (Note 7)
19642     *                              4 = solution didn't converge (Note 8)
19643     *                           else = binary logical OR of the above
19644     *
19645     * <p>Notes:
19646     * <ol>
19647     *
19648     * <li> The star data accepted by this function are "observables" for an
19649     *     imaginary observer at the solar-system barycenter.  Proper motion
19650     *     and radial velocity are, strictly, in terms of barycentric
19651     *     coordinate time, TCB.  For most practical applications, it is
19652     *     permissible to neglect the distinction between TCB and ordinary
19653     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
19654     *     limited by the intrinsic accuracy of the proper-motion and
19655     *     radial-velocity data;  moreover, the pv-vector is likely to be
19656     *     merely an intermediate result, so that a change of time unit
19657     *     would cancel out overall.
19658     *
19659     *     In accordance with normal star-catalog conventions, the object's
19660     *     right ascension and declination are freed from the effects of
19661     *     secular aberration.  The frame, which is aligned to the catalog
19662     *     equator and equinox, is Lorentzian and centered on the SSB.
19663     *
19664     * <li> The resulting position and velocity pv-vector is with respect to
19665     *     the same frame and, like the catalog coordinates, is freed from
19666     *     the effects of secular aberration.  Should the "coordinate
19667     *     direction", where the object was located at the catalog epoch, be
19668     *     required, it may be obtained by calculating the magnitude of the
19669     *     position vector pv[0][0-2] dividing by the speed of light in
19670     *     au/day to give the light-time, and then multiplying the space
19671     *     velocity pv[1][0-2] by this light-time and adding the result to
19672     *     pv[0][0-2].
19673     *
19674     *     Summarizing, the pv-vector returned is for most stars almost
19675     *     identical to the result of applying the standard geometrical
19676     *     "space motion" transformation.  The differences, which are the
19677     *     subject of the Stumpff paper referenced below, are:
19678     *
19679     *     (i) In stars with significant radial velocity and proper motion,
19680     *     the constantly changing light-time distorts the apparent proper
19681     *     motion.  Note that this is a classical, not a relativistic,
19682     *     effect.
19683     *
19684     *     (ii) The transformation complies with special relativity.
19685     *
19686     * <li> Care is needed with units.  The star coordinates are in radians
19687     *     and the proper motions in radians per Julian year, but the
19688     *     parallax is in arcseconds; the radial velocity is in km/s, but
19689     *     the pv-vector result is in au and au/day.
19690     *
19691     * <li> The RA proper motion is in terms of coordinate angle, not true
19692     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19693     *     motions, the RA proper motion will need to be divided by cos(Dec)
19694     *     before use.
19695     *
19696     * <li> Straight-line motion at constant speed, in the inertial frame,
19697     *     is assumed.
19698     *
19699     * <li> An extremely small (or zero or negative) parallax is interpreted
19700     *     to mean that the object is on the "celestial sphere", the radius
19701     *     of which is an arbitrary (large) value (see the constant PXMIN).
19702     *     When the distance is overridden in this way, the status,
19703     *     initially zero, has 1 added to it.
19704     *
19705     * <li> If the space velocity is a significant fraction of c (see the
19706     *     constant VMAX), it is arbitrarily set to zero.  When this action
19707     *     occurs, 2 is added to the status.
19708     *
19709     * <li> The relativistic adjustment involves an iterative calculation.
19710     *     If the process fails to converge within a set number (IMAX) of
19711     *     iterations, 4 is added to the status.
19712     *
19713     * <li> The inverse transformation is performed by the function
19714     *     jauPvstar.
19715     *</ol>
19716     *<p>Called:<ul>
19717     *     <li>{@link #jauS2pv} spherical coordinates to pv-vector
19718     *     <li>{@link #jauPm} modulus of p-vector
19719     *     <li>{@link #jauZp} zero p-vector
19720     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
19721     *     <li>{@link #jauPdp} scalar product of two p-vectors
19722     *     <li>{@link #jauSxp} multiply p-vector by scalar
19723     *     <li>{@link #jauPmp} p-vector minus p-vector
19724     *     <li>{@link #jauPpp} p-vector plus p-vector
19725     * </ul>
19726     *<p>Reference:
19727     *
19728     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
19729     *
19730     *@version 2009 July 6
19731     *
19732     *  @since Release 20101201
19733     *
19734     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19735     */
19736     public static int jauStarpv(double ra, double dec,
19737                   double pmr, double pmd, double px, double rv,
19738                   double pv[][])
19739     {
19740     /* Smallest allowed parallax */
19741        final double PXMIN = 1e-7;
19742 
19743     /* Largest allowed speed (fraction of c) */
19744        final double VMAX = 0.5;
19745 
19746     /* Maximum number of iterations for relativistic solution */
19747        final int IMAX = 100;
19748 
19749        int i, iwarn;
19750        double w, r, rd, rad, decd, v, x[] = new double[3], usr[] = new double[3], ust[] = new double[3],
19751               vsr, vst, betst, betsr, bett, betr,
19752               dd, ddel, ur[] = new double[3], ut[] = new double[3],
19753               d = 0.0, del = 0.0,       /* to prevent */
19754               odd = 0.0, oddel = 0.0,   /* compiler   */
19755               od = 0.0, odel = 0.0;     /* warnings   */
19756 
19757 
19758     /* Distance (au). */
19759        if (px >= PXMIN) {
19760           w = px;
19761           iwarn = 0;
19762        } else {
19763           w = PXMIN;
19764           iwarn = 1;
19765        }
19766        r = DR2AS / w;
19767 
19768     /* Radial velocity (au/day). */
19769        rd = DAYSEC * rv * 1e3 / DAU;
19770 
19771     /* Proper motion (radian/day). */
19772        rad = pmr / DJY;
19773        decd = pmd / DJY;
19774 
19775     /* To pv-vector (au,au/day). */
19776        double[][] pvt = jauS2pv(ra, dec, r, rad, decd, rd);
19777        jauCpv(pvt,pv);
19778 
19779     /* If excessive velocity, arbitrarily set it to zero. */
19780        v = jauPm(pv[1]);
19781        if (v / DC > VMAX) {
19782           jauZp(pv[1]);
19783           iwarn += 2;
19784        }
19785 
19786     /* Isolate the radial component of the velocity (au/day). */
19787        NormalizedVector nv = jauPn(pv[0]);
19788        w = nv.r;
19789        x = nv.u;
19790        vsr = jauPdp(x, pv[1]);
19791        usr = jauSxp(vsr,x);
19792 
19793     /* Isolate the transverse component of the velocity (au/day). */
19794        ust = jauPmp(pv[1], usr);
19795        vst = jauPm(ust);
19796 
19797     /* Special-relativity dimensionless parameters. */
19798        betsr = vsr / DC;
19799        betst = vst / DC;
19800 
19801     /* Determine the inertial-to-observed relativistic correction terms. */
19802        bett = betst;
19803        betr = betsr;
19804        for (i = 0; i < IMAX; i++) {
19805           d = 1.0 + betr;
19806           del = sqrt(1.0 - betr*betr - bett*bett) - 1.0;
19807           betr = d * betsr + del;
19808           bett = d * betst;
19809           if (i > 0) {
19810              dd = abs(d - od);
19811              ddel = abs(del - odel);
19812              if ((i > 1) && (dd >= odd) && (ddel >= oddel)) break;
19813              odd = dd;
19814              oddel = ddel;
19815           }
19816           od = d;
19817           odel = del;
19818        }
19819        if (i >= IMAX) iwarn += 4;
19820 
19821     /* Replace observed radial velocity with inertial value. */
19822        w = (betsr != 0.0) ? d + del / betsr : 1.0;
19823        ur = jauSxp(w,usr);
19824 
19825     /* Replace observed tangential velocity with inertial value. */
19826        ut = jauSxp(d,ust);
19827 
19828     /* Combine the two to obtain the inertial space velocity. */
19829        pv[1] = jauPpp(ur, ut);
19830        
19831     /* Return the status. */
19832        return iwarn;
19833 
19834         }
19835     
19836 
19837     /**
19838     *  Multiply a p-vector by a scalar.
19839     *
19840     *<p>This function is derived from the International Astronomical Union's
19841     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19842     *
19843     *<p>Status:  vector/matrix support function.
19844     *
19845     *<!-- Given: -->
19846     *     @param s       double         scalar
19847     *     @param p       double[3]      p-vector
19848     *
19849     *<!-- Returned: -->
19850     *     @return sp      double[3]       <u>returned</u> s * p
19851     *
19852     * 
19853     *
19854     *@version 2008 October 28
19855     *
19856     *  @since Release 20101201
19857     *
19858     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19859     */
19860     public static  double[] jauSxp(double s, double p[])
19861     {
19862        double sp[] = new double[3];
19863        sp[0] = s * p[0];
19864        sp[1] = s * p[1];
19865        sp[2] = s * p[2];
19866 
19867        return sp;
19868 
19869         }
19870     
19871 
19872     /**
19873     *  Multiply a pv-vector by a scalar.
19874     *
19875     *<p>This function is derived from the International Astronomical Union's
19876     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19877     *
19878     *<p>Status:  vector/matrix support function.
19879     *
19880     *<!-- Given: -->
19881     *     @param s        double           scalar
19882     *     @param pv       double[2][3]     pv-vector
19883     *
19884     *<!-- Returned: -->
19885     *     @return spv      double[2][3]      <u>returned</u> s * pv
19886     *
19887     *  Note:
19888     *     It is permissible for pv and psv to be the same array
19889     *
19890     *<p>Called:<ul>
19891     *     <li>{@link #jauS2xpv} multiply pv-vector by two scalars
19892     * </ul>
19893     *@version 2008 October 28
19894     *
19895     *  @since Release 20101201
19896     *
19897     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19898     */
19899     public static double[][] jauSxpv(double s, double pv[][])
19900     {
19901         double spv[][];
19902         spv = jauS2xpv(s, s, pv);
19903 
19904        return spv;
19905 
19906         }
19907 
19908     /**
19909      *
19910      *  Time scale transformation:  International Atomic Time, TAI, to
19911      *  Terrestrial Time, TT.
19912      *
19913      * <p>This function is derived from the International Astronomical Union's
19914      *  SOFA (Standards of Fundamental Astronomy) software collection.
19915      *
19916      *<p>Status:  canonical.
19917      *
19918      *<!-- Given: -->
19919      *  @param tai1 double    TAI as a 2-part Julian Date
19920      *  @param tai2 double    TAI as a 2-part Julian Date 
19921      *
19922      *<!-- Returned:-->
19923      *     @return JulianDate   TT as a 2-part Julian Date
19924      *
19925      *
19926      *  Note:
19927      *
19928      *     tai1+tai2 is Julian Date, apportioned in any convenient way
19929      *     between the two arguments, for example where tai1 is the Julian
19930      *     Day Number and tai2 is the fraction of a day.  The returned
19931      *     tt1,tt2 follow suit.
19932      *
19933      *<p>References:
19934      *
19935      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
19936      *     IERS Technical Note No. 32, BKG (2004)
19937      *
19938      *     Explanatory Supplement to the Astronomical Almanac,
19939      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
19940      *
19941      *@version 2010 May 16
19942      *
19943      *@since SOFA release 2010-12-01
19944      *
19945      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
19946      */
19947     public static JulianDate jauTaitt(double tai1, double tai2)
19948     {
19949 
19950         double tt1, tt2;
19951         /* TT minus TAI (days). */
19952         final double dtat = TTMTAI / DAYSEC;
19953 
19954         /* Result, safeguarding precision. */
19955         
19956         if ( abs(tai1) > abs(tai2) ) {
19957             tt1 = tai1;
19958             tt2 = tai2 + dtat;
19959         } else {
19960             tt1 = tai1 + dtat;
19961             tt2 = tai2;
19962         }
19963 
19964 
19965         return new JulianDate(tt1, tt2);
19966     };   
19967 
19968     /**
19969      *
19970      *  Time scale transformation:  International Atomic Time, TAI, to
19971      *  Universal Time, UT1.
19972      *
19973      * <p>This function is derived from the International Astronomical Union's
19974      *  SOFA (Standards of Fundamental Astronomy) software collection.
19975      *
19976      *<p>Status:  canonical.
19977      *
19978      *<!-- Given: -->
19979      *  @param tai1 double    TAI as a 2-part Julian Date
19980      *  @param tai2 double    TAI as a 2-part Julian Date 
19981      *  @param   dta        double    UT1-TAI in seconds
19982      *
19983      *<!-- Returned:-->
19984      *  @return      UT1 as a 2-part Julian Date
19985      *
19986      *
19987      *<p>Notes:
19988      *  <ol>
19989      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
19990      *     between the two arguments, for example where tai1 is the Julian
19991      *     Day Number and tai2 is the fraction of a day.  The returned
19992      *     UT11,UT12 follow suit.
19993      *
19994      *  <li>  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
19995      *     available from IERS tabulations.
19996      *  </ol>
19997      *  Reference:
19998      *
19999      *     Explanatory Supplement to the Astronomical Almanac,
20000      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20001      *
20002      *@version 2010 May 16
20003      *
20004      *@since SOFA release 2010-12-01
20005      *
20006      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20007      *
20008      */
20009     public static JulianDate jauTaiut1(double tai1, double tai2, double dta)
20010 
20011     {
20012         double dtad,ut11, ut12;
20013 
20014 
20015         /* Result, safeguarding precision. */
20016         dtad = dta / DAYSEC;
20017         if ( abs(tai1) > abs(tai2) ) {
20018             ut11 = tai1;
20019             ut12 = tai2 + dtad;
20020         } else {
20021             ut11 = tai1 + dtad;
20022             ut12 = tai2;
20023         }
20024 
20025         return new JulianDate(ut11, ut12);
20026     };   
20027 
20028     /**
20029      *
20030      *  Time scale transformation:  International Atomic Time, TAI, to
20031      *  Coordinated Universal Time, UTC.
20032      *
20033      * <p>This function is derived from the International Astronomical Union's
20034      *  SOFA (Standards of Fundamental Astronomy) software collection.
20035      *
20036      *<p>Status:  canonical.
20037      *
20038      *<!-- Given: -->
20039      *  @param tai1 TAI as a 2-part Julian Date (Note 1)
20040      *  @param tai2 TAI as a 2-part Julian Date (Note 1) 
20041      *
20042      *<!-- Returned:-->
20043      *  @return   UTC as a 2-part quasi Julian Date (Notes 1-3)
20044      *
20045      *  Returned (function value):
20046      *                int      status: +1 = dubious year (Note 4)
20047      *                                  0 = OK
20048      *                                 -1 = unacceptable date
20049      *
20050      *<p>Notes:</p>
20051      * <ol>
20052      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
20053      *     between the two arguments, for example where tai1 is the Julian
20054      *     Day Number and tai2 is the fraction of a day.  The returned utc1
20055      *     and utc2 form an analogous pair, except that a special convention
20056      *     is used, to deal with the problem of leap seconds - see the next
20057      *     note.
20058      *
20059      *  <li> JD cannot unambiguously represent UTC during a leap second unless
20060      *     special measures are taken.  The convention in the present
20061      *     function is that the JD day represents UTC days whether the
20062      *     length is 86399, 86400 or 86401 SI seconds.
20063      *
20064      *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
20065      *     into calendar date and clock time, including UTC leap second
20066      *     handling.
20067      *
20068      *  <li> The warning status "dubious year" flags UTCs that predate the
20069      *     introduction of the time scale and that are too far in the future
20070      *     to be trusted.  See jauDat for further details.
20071      *  </ol>
20072      *  Called:
20073      *  <ul>
20074      *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
20075      *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
20076      *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
20077      *</ul>
20078      *<p>References:
20079      *
20080      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20081      *     IERS Technical Note No. 32, BKG (2004)
20082      *
20083      *     Explanatory Supplement to the Astronomical Almanac,
20084      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20085      *
20086      *@version 2010 May 16
20087      *
20088      *@since SOFA release 2010-12-01
20089      *
20090      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20091      * @throws JSOFAIllegalParameter 
20092      * @throws JSOFAInternalError an internal error has occured
20093      */
20094     public static JulianDate jauTaiutc(double tai1, double tai2) throws JSOFAIllegalParameter, JSOFAInternalError
20095     {
20096         boolean big1;
20097         int i;
20098         double a1, a2,dats1, ddats, dats2, datd = 0.0, as1, as2, da, d1, d2, fd;
20099         double utc1, utc2;
20100 
20101 
20102         /* Put the two parts of the TAI into big-first order. */
20103         big1 = ( abs(tai1) >= abs(tai2) );
20104         if ( big1 ) {
20105             a1 = tai1;
20106             a2 = tai2;
20107         } else {
20108             a1 = tai2;
20109             a2 = tai1;
20110         }
20111 
20112         /* See if the TAI can possibly be in a leap-second day. */
20113         d1 = a1;
20114         dats1 = 0.0;
20115         for ( i = -1; i <= 3; i++ ) {
20116             d2 = a2 + (double) i;
20117             Calendar dt;
20118             dt = jauJd2cal(d1, d2 );
20119             dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
20120 //FIXME            if ( js < 0 ) return -1;
20121             if ( i == -1 ) dats1 = dats2;
20122             ddats = dats2 - dats1;
20123             datd = dats1 / DAYSEC;
20124             if ( abs(ddats) >= 0.5 ) {
20125 
20126                 /* Yes.  Get TAI for the start of the UTC day that */
20127                 /* ends in a leap. */
20128                 JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
20129                 d1 = jd.djm0; d2 = jd.djm1;
20130                 as1 = d1;
20131                 as2 = d2 - 1.0 + datd;
20132 
20133                 /* Is the TAI after this point? */
20134                 da = a1 - as1;
20135                 da = da + ( a2 - as2 );
20136                 if ( da > 0 ) {
20137 
20138                     /* Yes:  fraction of the current UTC day that has elapsed. */
20139                     fd = da * DAYSEC / ( DAYSEC + ddats );
20140 
20141                     /* Ramp TAI-UTC to bring about SOFA's JD(UTC) convention. */
20142                     datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / DAYSEC;
20143                 }
20144 
20145                 /* Done. */
20146                 break;
20147             }
20148             dats1 = dats2;
20149         }
20150 
20151         /* Subtract the (possibly adjusted) TAI-UTC from TAI to give UTC. */
20152         a2 -= datd;
20153 
20154         /* Return the UTC result, preserving the TAI order. */
20155         if ( big1 ) {
20156             utc1 = a1;
20157             utc2 = a2;
20158         } else {
20159             utc1 = a2;
20160             utc2 = a1;
20161         }
20162 
20163         /* TODO Status */
20164         return new JulianDate(utc1, utc2);
20165 
20166     };
20167 
20168     /**
20169      *
20170      *  Time scale transformation:  Barycentric Coordinate Time, TCB, to
20171      *  Barycentric Dynamical Time, TDB.
20172      *
20173      * <p>This function is derived from the International Astronomical Union's
20174      *  SOFA (Standards of Fundamental Astronomy) software collection.
20175      *
20176      *<p>Status:  canonical.
20177      *
20178      *<!-- Given: -->
20179      *   @param tcb1 double    TCB as a 2-part Julian Date
20180      *   @param tcb2 double    TCB as a 2-part Julian Date 
20181      *
20182      *<!-- Returned:-->
20183      *   @return    TDB as a 2-part Julian Date
20184      *
20185      *
20186      *<p>Notes:
20187      *  <ol>
20188      * <li>  tcb1+tcb2 is Julian Date, apportioned in any convenient way
20189      *     between the two arguments, for example where tcb1 is the Julian
20190      *     Day Number and tcb2 is the fraction of a day.  The returned
20191      *     tdb1,tdb2 follow suit.
20192      *
20193      * <li>  The 2006 IAU General Assembly introduced a conventional linear
20194      *     transformation between TDB and TCB.  This transformation
20195      *     compensates for the drift between TCB and terrestrial time TT,
20196      *     and keeps TDB approximately centered on TT.  Because the
20197      *     relationship between TT and TCB depends on the adopted solar
20198      *     system ephemeris, the degree of alignment between TDB and TT over
20199      *     long intervals will vary according to which ephemeris is used.
20200      *     Former definitions of TDB attempted to avoid this problem by
20201      *     stipulating that TDB and TT should differ only by periodic
20202      *     effects.  This is a good description of the nature of the
20203      *     relationship but eluded precise mathematical formulation.  The
20204      *     conventional linear relationship adopted in 2006 sidestepped
20205      *     these difficulties whilst delivering a TDB that in practice was
20206      *     consistent with values before that date.
20207      *
20208      *  <li>  TDB is essentially the same as Teph, the time argument for the
20209      *     JPL solar system ephemerides.
20210      * </ol>
20211      *  Reference:
20212      *
20213      *     IAU 2006 Resolution B3
20214      *
20215      *@version 2010 May 16
20216      *
20217      *@since SOFA release 2010-12-01
20218      *
20219      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20220      */
20221     public static JulianDate jauTcbtdb(double tcb1, double tcb2)
20222     {
20223         double tdb1, tdb2;
20224         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20225         final double t77td = DJM0 + DJM77;
20226         final double t77tf = TTMTAI/DAYSEC;
20227 
20228         /* TDB (days) at TAI 1977 Jan 1.0 */
20229         final double tdb0 = TDB0/86400.0;
20230 
20231         double d;
20232 
20233 
20234         /* Result, safeguarding precision. */
20235         if ( abs(tcb1) > abs(tcb2) ) {
20236             d = tcb1 - t77td;
20237             tdb1 = tcb1;
20238             tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ELB;
20239         } else {
20240             d = tcb2 - t77td;
20241             tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ELB;
20242             tdb2 = tcb2;
20243         }
20244 
20245 
20246         return new JulianDate(tdb1, tdb2);
20247 
20248     };
20249 
20250     /**
20251      *  Time scale transformation:  Geocentric Coordinate Time, TCG, to
20252      *  Terrestrial Time, TT.
20253      *
20254      * <p>This function is derived from the International Astronomical Union's
20255      *  SOFA (Standards of Fundamental Astronomy) software collection.
20256      *
20257      *<p>Status:  canonical.
20258      *
20259      *<!-- Given: -->
20260      *  @param tcg1 double    TCG as a 2-part Julian Date
20261      *  @param tcg2 double    TCG as a 2-part Julian Date 
20262      *
20263      *<!-- Returned:-->
20264      *   @return    TT as a 2-part Julian Date
20265      *
20266      *
20267      *  Note:
20268      *
20269      *     tcg1+tcg2 is Julian Date, apportioned in any convenient way
20270      *     between the two arguments, for example where tcg1 is the Julian
20271      *     Day Number and tcg22 is the fraction of a day.  The returned
20272      *     tt1,tt2 follow suit.
20273      *
20274      *<p>References:
20275      *
20276      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),.
20277      *     IERS Technical Note No. 32, BKG (2004)
20278      *
20279      *     IAU 2000 Resolution B1.9
20280      *
20281      *@version 2010 May 14
20282      *
20283      *@since SOFA release 2010-12-01
20284      *
20285      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20286      */
20287     public static JulianDate jauTcgtt(double tcg1, double tcg2)
20288     {
20289         double tt1,tt2;
20290         /* 1977 Jan 1 00:00:32.184 TT, as MJD */
20291         final double t77t = DJM77 + TTMTAI/DAYSEC;
20292 
20293 
20294         /* Result, safeguarding precision. */
20295         if ( abs(tcg1) > abs(tcg2) ) {
20296             tt1 = tcg1;
20297             tt2 = tcg2 - ( ( tcg1 - DJM0 ) + ( tcg2 - t77t ) ) * ELG;
20298         } else {
20299             tt1 = tcg1 - ( ( tcg2 - DJM0 ) + ( tcg1 - t77t ) ) * ELG;
20300             tt2 = tcg2;
20301         }
20302 
20303         return new JulianDate(tt1, tt2);
20304     };
20305 
20306 
20307     /**
20308      *
20309      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20310      *  Barycentric Coordinate Time, TCB.
20311      *
20312      * <p>This function is derived from the International Astronomical Union's
20313      *  SOFA (Standards of Fundamental Astronomy) software collection.
20314      *
20315      *<p>Status:  canonical.
20316      *
20317      *<!-- Given: -->
20318      *   @param tdb1 TDB as a 2-part Julian Date
20319      *   @param tdb2 TDB as a 2-part Julian Date 
20320      *
20321      *<!-- Returned:-->
20322      *   @return    TCB as a 2-part Julian Date
20323      *
20324      *<p>Notes:
20325      * <ol>
20326      *  <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20327      *     between the two arguments, for example where tdb1 is the Julian
20328      *     Day Number and tdb2 is the fraction of a day.  The returned
20329      *     tcb1,tcb2 follow suit.
20330      *
20331      *  <li> The 2006 IAU General Assembly introduced a conventional linear
20332      *     transformation between TDB and TCB.  This transformation
20333      *     compensates for the drift between TCB and terrestrial time TT,
20334      *     and keeps TDB approximately centered on TT.  Because the
20335      *     relationship between TT and TCB depends on the adopted solar
20336      *     system ephemeris, the degree of alignment between TDB and TT over
20337      *     long intervals will vary according to which ephemeris is used.
20338      *     Former definitions of TDB attempted to avoid this problem by
20339      *     stipulating that TDB and TT should differ only by periodic
20340      *     effects.  This is a good description of the nature of the
20341      *     relationship but eluded precise mathematical formulation.  The
20342      *     conventional linear relationship adopted in 2006 sidestepped
20343      *     these difficulties whilst delivering a TDB that in practice was
20344      *     consistent with values before that date.
20345      *
20346      * <li>  TDB is essentially the same as Teph, the time argument for the
20347      *     JPL solar system ephemerides.
20348      *  </ol>
20349      *  Reference:
20350      *
20351      *     IAU 2006 Resolution B3
20352      *
20353      *@version 2010 September 10
20354      *
20355      *@since SOFA release 2010-12-01
20356      *
20357      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20358      */
20359     public static JulianDate jauTdbtcb(double tdb1, double tdb2 )
20360     {
20361         double tcb1, tcb2;
20362         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20363         final double t77td = DJM0 + DJM77;
20364         final double t77tf = TTMTAI/DAYSEC;
20365 
20366         /* TDB (days) at TAI 1977 Jan 1.0 */
20367         final double tdb0 = TDB0/DAYSEC;
20368 
20369         /* TDB to TCB rate */
20370         final double elbb = ELB/(1.0-ELB);
20371 
20372         double d, f;
20373 
20374 
20375         /* Result, preserving date format but safeguarding precision. */
20376         if ( abs(tdb1) > abs(tdb2) ) {
20377             d = t77td - tdb1;
20378             f  = tdb2 - tdb0;
20379             tcb1 = tdb1;
20380             tcb2 = f - ( d - ( f - t77tf ) ) * elbb;
20381         } else {
20382             d = t77td - tdb2;
20383             f  = tdb1 - tdb0;
20384             tcb1 = f - ( d - ( f - t77tf ) ) * elbb;
20385             tcb2 = tdb2;
20386         }
20387 
20388         return new JulianDate(tcb1, tcb2);
20389 
20390     };
20391 
20392 
20393     /**
20394      *
20395      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20396      *  Terrestrial Time, TT.
20397      *
20398      * <p>This function is derived from the International Astronomical Union's
20399      *  SOFA (Standards of Fundamental Astronomy) software collection.
20400      *
20401      *<p>Status:  canonical.
20402      *
20403      *<!-- Given: -->
20404      *    @param tdb1 double    TDB as a 2-part Julian Date
20405      *    @param tdb2 double    TDB as a 2-part Julian Date 
20406      *    @param dtr        double    TDB-TT in seconds
20407      *
20408      *<!-- Returned:-->
20409      *   @return   TT as a 2-part Julian Date
20410      *
20411      *
20412      *<p>Notes:
20413      * <ol>
20414      * <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20415      *     between the two arguments, for example where tdb1 is the Julian
20416      *     Day Number and tdb2 is the fraction of a day.  The returned
20417      *     tt1,tt2 follow suit.
20418      *
20419      *  <li>  The argument dtr represents the quasi-periodic component of the
20420      *     GR transformation between TT and TCB.  It is dependent upon the
20421      *     adopted solar-system ephemeris, and can be obtained by numerical
20422      *     integration, by interrogating a precomputed time ephemeris or by
20423      *     evaluating a model such as that implemented in the SOFA function
20424      *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
20425      *     amplitude.
20426      *
20427      *  <li>  TDB is essentially the same as Teph, the time argument for the
20428      *     JPL solar system ephemerides.
20429      *  </ol>
20430      *<p>References:
20431      *
20432      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20433      *     IERS Technical Note No. 32, BKG (2004)
20434      *
20435      *     IAU 2006 Resolution 3
20436      *
20437      *@version 2010 May 13
20438      *
20439      *@since SOFA release 2010-12-01
20440      *
20441      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20442      *
20443      */
20444     public static JulianDate jauTdbtt(double tdb1, double tdb2, double dtr  )
20445     {
20446         double tt1, tt2;
20447         double dtrd;
20448 
20449 
20450         /* Result, safeguarding precision. */
20451         dtrd = dtr / DAYSEC;
20452         if ( abs(tdb1) > abs(tdb2) ) {
20453             tt1 = tdb1;
20454             tt2 = tdb2 - dtrd;
20455         } else {
20456             tt1 = tdb1 - dtrd;
20457             tt2 = tdb2;
20458         }
20459 
20460         return new JulianDate(tt1, tt2);
20461 
20462     }
20463 
20464     /**
20465      *
20466      *  Convert hours, minutes, seconds to radians.
20467      *
20468      * <p>This function is derived from the International Astronomical Union's
20469      *  SOFA (Standards of Fundamental Astronomy) software collection.
20470      *
20471      *<p>Status:  support function.
20472      *
20473      *<!-- Given: -->
20474      *     @param s         char     sign:  '-' = negative, otherwise positive
20475      *     @param ihour     int     hours
20476      *     @param imin      int     minutes
20477      *     @param sec       double  seconds
20478      *
20479      *<!-- Returned:-->
20480      *     @return      double  angle in radians
20481      *@throws JSOFAIllegalParameter illegal parameter of some form
20482      *  Returned (function value):
20483      *               int     status:  0 = OK
20484      *                                1 = ihour outside range 0-23
20485      *                                2 = imin outside range 0-59
20486      *                                3 = sec outside range 0-59.999...
20487      *
20488      *<p>Notes:
20489      *<ul>
20490      *  <li>  The result is computed even if any of the range checks fail.
20491      *
20492      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20493      *      the absolute value is used in the conversion.
20494      *</ul>
20495      *@version 2010 August 27
20496      *
20497      *@since SOFA release 2010-12-01
20498      *
20499      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20500      * 
20501      */
20502     public static double jauTf2a(char s, int ihour, int imin, double sec ) throws JSOFAIllegalParameter
20503     {
20504         double rad;
20505 
20506         /* Compute the interval. */
20507         rad  = ( s == '-' ? -1.0 : 1.0 ) *
20508                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20509                         ( (double) abs(imin) ) ) +
20510                         abs(sec) ) * DS2R;
20511 
20512         /*  Validate arguments and return status. */
20513         if ( ihour < 0 || ihour > 23 ) throw new JSOFAIllegalParameter("bad hour", 1);   
20514         if ( imin < 0 || imin > 59 )   throw new JSOFAIllegalParameter("bad minute", 2); 
20515         if ( sec < 0.0 || sec >= 60.0 )throw new JSOFAIllegalParameter("bad second", 3); 
20516         return rad;
20517 
20518     };
20519 
20520     /**
20521      *
20522      *  Convert hours, minutes, seconds to days.
20523      *
20524      * <p>This function is derived from the International Astronomical Union's
20525      *  SOFA (Standards of Fundamental Astronomy) software collection.
20526      *
20527      *<p>Status:  support function.
20528      *
20529      *<!-- Given: -->
20530      *     @param s         char     sign:  '-' = negative, otherwise positive
20531      *     @param ihour     int     hours
20532      *     @param imin      int     minutes
20533      *     @param sec       double  seconds
20534      *
20535      *<!-- Returned:-->
20536      *     @return      double  interval in days
20537      *
20538      *  Returned (function value):
20539      *               int     status:  0 = OK
20540      *                                1 = ihour outside range 0-23
20541      *                                2 = imin outside range 0-59
20542      *                                3 = sec outside range 0-59.999...
20543      *
20544      *<p>Notes:
20545      *<ol>
20546      *  <li>  The result is computed even if any of the range checks fail.
20547      *
20548      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20549      *      the absolute value is used in the conversion.
20550      *</ol>
20551      *@version 2010 August 27
20552      *
20553      *@since SOFA release 2010-12-01
20554      *
20555      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20556      * @throws JSOFAIllegalParameter 
20557      */
20558     public static double jauTf2d(char s, int ihour, int imin, double sec) throws JSOFAIllegalParameter
20559     {
20560         double days;
20561         /* Compute the interval. */
20562         days  = ( s == '-' ? -1.0 : 1.0 ) *
20563                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20564                         ( (double) abs(imin) ) ) +
20565                         abs(sec) ) / DAYSEC;
20566 
20567         /* FIXME Validate arguments and return status. */
20568         if ( ihour < 0 || ihour > 23 )  throw new JSOFAIllegalParameter("bad hour", 1);
20569         if ( imin < 0 || imin > 59 )    throw new JSOFAIllegalParameter("bad minute", 2);
20570         if ( sec < 0.0 || sec >= 60.0 ) throw new JSOFAIllegalParameter("bad second", 3);
20571         return days;
20572 
20573     }
20574 
20575     /**
20576      *  Transpose an r-matrix.
20577      *
20578      *<p>This function is derived from the International Astronomical Union's
20579      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20580      *
20581      *<p>Status:  vector/matrix support function.
20582      *
20583      *<!-- Given: -->
20584      *     @param r         double[3][3]     r-matrix
20585      *
20586      *<!-- Returned: -->
20587      *     @return rt        double[3][3]      <u>returned</u> transpose
20588      *
20589      *  Note:
20590      *     It is permissible for r and rt to be the same array.
20591      *
20592      *<p>Called:<ul>
20593      *     <li>{@link #jauCr} copy r-matrix
20594      * </ul>
20595      *@version 2008 May 22
20596      *
20597      *  @since Release 20101201
20598      *
20599      *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20600      */
20601     public static double[][] jauTr(double r[][])
20602     {
20603         double wm[][]= new double[3][3];
20604         int i, j;
20605 
20606 
20607         for (i = 0; i < 3; i++) {
20608             for (j = 0; j < 3; j++) {
20609                 wm[i][j] = r[j][i];
20610             }
20611         }
20612 
20613 
20614         return wm;
20615 
20616     }
20617 
20618 
20619     /**
20620      *  Multiply a p-vector by the transpose of an r-matrix.
20621      *
20622      *<p>This function is derived from the International Astronomical Union's
20623      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20624      *
20625      *<p>Status:  vector/matrix support function.
20626      *
20627      *<!-- Given: -->
20628      *     @param r         double[3][3]    r-matrix
20629      *     @param p         double[3]       p-vector
20630      *
20631      *<!-- Returned: -->
20632      *     @return trp       double[3]        <u>returned</u> r * p
20633      *
20634      *  Note:
20635      *     It is permissible for p and trp to be the same array.
20636      *
20637      *<p>Called:<ul>
20638      *     <li>{@link #jauTr} transpose r-matrix
20639     *     <li>{@link #jauRxp} product of r-matrix and p-vector
20640     * </ul>
20641     *@version 2008 October 28
20642     *
20643     *  @since Release 20101201
20644     *
20645     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20646     */
20647     public static double[] jauTrxp(double r[][], double p[]  )
20648     {
20649        double tr[][];
20650        double trp[];
20651 
20652     /* Transpose of matrix r. */
20653        tr = jauTr(r);
20654 
20655     /* Matrix tr * vector p -> vector trp. */
20656        trp = jauRxp(tr, p);
20657 
20658        return trp;
20659 
20660         }
20661     
20662 
20663     /**
20664     *  Multiply a pv-vector by the transpose of an r-matrix.
20665     *
20666     *<p>This function is derived from the International Astronomical Union's
20667     *  SOFA (Standards Of Fundamental Astronomy) software collection.
20668     *
20669     *<p>Status:  vector/matrix support function.
20670     *
20671     *<!-- Given: -->
20672     *     @param r         double[3][3]     r-matrix
20673     *     @param pv        double[2][3]     pv-vector
20674     *
20675     *<!-- Returned: -->
20676     *     @return trpv      double[2][3]      <u>returned</u> r * pv
20677     *
20678     *  Note:
20679     *     It is permissible for pv and trpv to be the same array.
20680     *
20681     *<p>Called:<ul>
20682     *     <li>{@link #jauTr} transpose r-matrix
20683     *     <li>{@link #jauRxpv} product of r-matrix and pv-vector
20684     * </ul>
20685     *@version 2008 October 28
20686     *
20687     *  @since Release 20101201
20688     *
20689     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20690     */
20691     public static double[][] jauTrxpv(double r[][], double pv[][] )
20692     {
20693        double tr[][], trpv[][];
20694 
20695 
20696     /* Transpose of matrix r. */
20697        tr = jauTr(r);
20698 
20699     /* Matrix tr * vector pv -> vector trpv. */
20700        trpv = jauRxpv(tr, pv);
20701 
20702        return trpv;
20703 
20704         }
20705     
20706     /*
20707      * constant arrays set outside jauXy06 to avoid problems with 65535 byte limit on function size
20708      */
20709     static {
20710         /* need to define this function because it appears that javac lumps all of the statically defined initalizers into one function on 
20711          * compilation - so this will force a second function */
20712         init_mfals();
20713     }
20714     /** Fundamental-argument multipliers:  luni-solar terms */
20715     private static int mfals[][]; //IMPL would like to be final really
20716     
20717     private static void init_mfals(){
20718         
20719     mfals = new int[][]
20720     {
20721 
20722    /* 1-10 */
20723       {  0,   0,   0,   0,   1 },
20724       {  0,   0,   2,  -2,   2 },
20725       {  0,   0,   2,   0,   2 },
20726       {  0,   0,   0,   0,   2 },
20727       {  0,   1,   0,   0,   0 },
20728       {  0,   1,   2,  -2,   2 },
20729       {  1,   0,   0,   0,   0 },
20730       {  0,   0,   2,   0,   1 },
20731       {  1,   0,   2,   0,   2 },
20732       {  0,   1,  -2,   2,  -2 },
20733 
20734    /* 11-20 */
20735       {  0,   0,   2,  -2,   1 },
20736       {  1,   0,  -2,   0,  -2 },
20737       {  1,   0,   0,  -2,   0 },
20738       {  1,   0,   0,   0,   1 },
20739       {  1,   0,   0,   0,  -1 },
20740       {  1,   0,  -2,  -2,  -2 },
20741       {  1,   0,   2,   0,   1 },
20742       {  2,   0,  -2,   0,  -1 },
20743       {  0,   0,   0,   2,   0 },
20744       {  0,   0,   2,   2,   2 },
20745 
20746    /* 21-30 */
20747       {  2,   0,   0,  -2,   0 },
20748       {  0,   2,  -2,   2,  -2 },
20749       {  2,   0,   2,   0,   2 },
20750       {  1,   0,   2,  -2,   2 },
20751       {  1,   0,  -2,   0,  -1 },
20752       {  2,   0,   0,   0,   0 },
20753       {  0,   0,   2,   0,   0 },
20754       {  0,   1,   0,   0,   1 },
20755       {  1,   0,   0,  -2,  -1 },
20756       {  0,   2,   2,  -2,   2 },
20757 
20758    /* 31-40 */
20759       {  0,   0,   2,  -2,   0 },
20760       {  1,   0,   0,  -2,   1 },
20761       {  0,   1,   0,   0,  -1 },
20762       {  0,   2,   0,   0,   0 },
20763       {  1,   0,  -2,  -2,  -1 },
20764       {  1,   0,   2,   2,   2 },
20765       {  0,   1,   2,   0,   2 },
20766       {  2,   0,  -2,   0,   0 },
20767       {  0,   0,   2,   2,   1 },
20768       {  0,   1,  -2,   0,  -2 },
20769 
20770    /* 41-50 */
20771       {  0,   0,   0,   2,   1 },
20772       {  1,   0,   2,  -2,   1 },
20773       {  2,   0,   0,  -2,  -1 },
20774       {  2,   0,   2,  -2,   2 },
20775       {  2,   0,   2,   0,   1 },
20776       {  0,   0,   0,   2,  -1 },
20777       {  0,   1,  -2,   2,  -1 },
20778       {  1,   1,   0,  -2,   0 },
20779       {  2,   0,   0,  -2,   1 },
20780       {  1,   0,   0,   2,   0 },
20781 
20782    /* 51-60 */
20783       {  0,   1,   2,  -2,   1 },
20784       {  1,  -1,   0,   0,   0 },
20785       {  0,   1,  -1,   1,  -1 },
20786       {  2,   0,  -2,   0,  -2 },
20787       {  0,   1,   0,  -2,   0 },
20788       {  1,   0,   0,  -1,   0 },
20789       {  3,   0,   2,   0,   2 },
20790       {  0,   0,   0,   1,   0 },
20791       {  1,  -1,   2,   0,   2 },
20792       {  1,   1,  -2,  -2,  -2 },
20793 
20794    /* 61-70 */
20795       {  1,   0,  -2,   0,   0 },
20796       {  2,   0,   0,   0,  -1 },
20797       {  0,   1,  -2,  -2,  -2 },
20798       {  1,   1,   2,   0,   2 },
20799       {  2,   0,   0,   0,   1 },
20800       {  1,   1,   0,   0,   0 },
20801       {  1,   0,  -2,   2,  -1 },
20802       {  1,   0,   2,   0,   0 },
20803       {  1,  -1,   0,  -1,   0 },
20804       {  1,   0,   0,   0,   2 },
20805 
20806    /* 71-80 */
20807       {  1,   0,  -1,   0,  -1 },
20808       {  0,   0,   2,   1,   2 },
20809       {  1,   0,  -2,  -4,  -2 },
20810       {  1,  -1,   0,  -1,  -1 },
20811       {  1,   0,   2,   2,   1 },
20812       {  0,   2,  -2,   2,  -1 },
20813       {  1,   0,   0,   0,  -2 },
20814       {  2,   0,  -2,  -2,  -2 },
20815       {  1,   1,   2,  -2,   2 },
20816       {  2,   0,  -2,  -4,  -2 },
20817 
20818    /* 81-90 */
20819       {  1,   0,  -4,   0,  -2 },
20820       {  2,   0,   2,  -2,   1 },
20821       {  1,   0,   0,  -1,  -1 },
20822       {  2,   0,   2,   2,   2 },
20823       {  3,   0,   0,   0,   0 },
20824       {  1,   0,   0,   2,   1 },
20825       {  0,   0,   2,  -2,  -1 },
20826       {  3,   0,   2,  -2,   2 },
20827       {  0,   0,   4,  -2,   2 },
20828       {  1,   0,   0,  -4,   0 },
20829 
20830    /* 91-100 */
20831       {  0,   1,   2,   0,   1 },
20832       {  2,   0,   0,  -4,   0 },
20833       {  1,   1,   0,  -2,  -1 },
20834       {  2,   0,  -2,   0,   1 },
20835       {  0,   0,   2,   0,  -1 },
20836       {  0,   1,  -2,   0,  -1 },
20837       {  0,   1,   0,   0,   2 },
20838       {  0,   0,   2,  -1,   2 },
20839       {  0,   0,   2,   4,   2 },
20840       {  2,   1,   0,  -2,   0 },
20841 
20842    /* 101-110 */
20843       {  1,   1,   0,  -2,   1 },
20844       {  1,  -1,   0,  -2,   0 },
20845       {  1,  -1,   0,  -1,  -2 },
20846       {  1,  -1,   0,   0,   1 },
20847       {  0,   1,  -2,   2,   0 },
20848       {  0,   1,   0,   0,  -2 },
20849       {  1,  -1,   2,   2,   2 },
20850       {  1,   0,   0,   2,  -1 },
20851       {  1,  -1,  -2,  -2,  -2 },
20852       {  3,   0,   2,   0,   1 },
20853 
20854    /* 111-120 */
20855       {  0,   1,   2,   2,   2 },
20856       {  1,   0,   2,  -2,   0 },
20857       {  1,   1,  -2,  -2,  -1 },
20858       {  1,   0,   2,  -4,   1 },
20859       {  0,   1,  -2,  -2,  -1 },
20860       {  2,  -1,   2,   0,   2 },
20861       {  0,   0,   0,   2,   2 },
20862       {  1,  -1,   2,   0,   1 },
20863       {  1,  -1,  -2,   0,  -2 },
20864       {  0,   1,   0,   2,   0 },
20865 
20866    /* 121-130 */
20867       {  0,   1,   2,  -2,   0 },
20868       {  0,   0,   0,   1,   1 },
20869       {  1,   0,  -2,  -2,   0 },
20870       {  0,   3,   2,  -2,   2 },
20871       {  2,   1,   2,   0,   2 },
20872       {  1,   1,   0,   0,   1 },
20873       {  2,   0,   0,   2,   0 },
20874       {  1,   1,   2,   0,   1 },
20875       {  1,   0,   0,  -2,  -2 },
20876       {  1,   0,  -2,   2,   0 },
20877 
20878    /* 131-140 */
20879       {  1,   0,  -1,   0,  -2 },
20880       {  0,   1,   0,  -2,   1 },
20881       {  0,   1,   0,   1,   0 },
20882       {  0,   0,   0,   1,  -1 },
20883       {  1,   0,  -2,   2,  -2 },
20884       {  1,  -1,   0,   0,  -1 },
20885       {  0,   0,   0,   4,   0 },
20886       {  1,  -1,   0,   2,   0 },
20887       {  1,   0,   2,   1,   2 },
20888       {  1,   0,   2,  -1,   2 },
20889 
20890    /* 141-150 */
20891       {  0,   0,   2,   1,   1 },
20892       {  1,   0,   0,  -2,   2 },
20893       {  1,   0,  -2,   0,   1 },
20894       {  1,   0,  -2,  -4,  -1 },
20895       {  0,   0,   2,   2,   0 },
20896       {  1,   1,   2,  -2,   1 },
20897       {  1,   0,  -2,   1,  -1 },
20898       {  0,   0,   1,   0,   1 },
20899       {  2,   0,  -2,  -2,  -1 },
20900       {  4,   0,   2,   0,   2 },
20901 
20902    /* 151-160 */
20903       {  2,  -1,   0,   0,   0 },
20904       {  2,   1,   2,  -2,   2 },
20905       {  0,   1,   2,   1,   2 },
20906       {  1,   0,   4,  -2,   2 },
20907       {  1,   1,   0,   0,  -1 },
20908       {  2,   0,   2,   0,   0 },
20909       {  2,   0,  -2,  -4,  -1 },
20910       {  1,   0,  -1,   0,   0 },
20911       {  1,   0,   0,   1,   0 },
20912       {  0,   1,   0,   2,   1 },
20913 
20914    /* 161-170 */
20915       {  1,   0,  -4,   0,  -1 },
20916       {  1,   0,   0,  -4,  -1 },
20917       {  2,   0,   2,   2,   1 },
20918       {  2,   1,   0,   0,   0 },
20919       {  0,   0,   2,  -3,   2 },
20920       {  1,   2,   0,  -2,   0 },
20921       {  0,   3,   0,   0,   0 },
20922       {  0,   0,   4,   0,   2 },
20923       {  0,   0,   2,  -4,   1 },
20924       {  2,   0,   0,  -2,  -2 },
20925 
20926    /* 171-180 */
20927       {  1,   1,  -2,  -4,  -2 },
20928       {  0,   1,   0,  -2,  -1 },
20929       {  0,   0,   0,   4,   1 },
20930       {  3,   0,   2,  -2,   1 },
20931       {  1,   0,   2,   4,   2 },
20932       {  1,   1,  -2,   0,  -2 },
20933       {  0,   0,   4,  -2,   1 },
20934       {  2,  -2,   0,  -2,   0 },
20935       {  2,   1,   0,  -2,  -1 },
20936       {  0,   2,   0,  -2,   0 },
20937 
20938    /* 181-190 */
20939       {  1,   0,   0,  -1,   1 },
20940       {  1,   1,   2,   2,   2 },
20941       {  3,   0,   0,   0,  -1 },
20942       {  2,   0,   0,  -4,  -1 },
20943       {  3,   0,   2,   2,   2 },
20944       {  0,   0,   2,   4,   1 },
20945       {  0,   2,  -2,  -2,  -2 },
20946       {  1,  -1,   0,  -2,  -1 },
20947       {  0,   0,   2,  -1,   1 },
20948       {  2,   0,   0,   2,   1 },
20949 
20950    /* 191-200 */
20951       {  1,  -1,  -2,   2,  -1 },
20952       {  0,   0,   0,   2,  -2 },
20953       {  2,   0,   0,  -4,   1 },
20954       {  1,   0,   0,  -4,   1 },
20955       {  2,   0,   2,  -4,   1 },
20956       {  4,   0,   2,  -2,   2 },
20957       {  2,   1,  -2,   0,  -1 },
20958       {  2,   1,  -2,  -4,  -2 },
20959       {  3,   0,   0,  -4,   0 },
20960       {  1,  -1,   2,   2,   1 },
20961 
20962    /* 201-210 */
20963       {  1,  -1,  -2,   0,  -1 },
20964       {  0,   2,   0,   0,   1 },
20965       {  1,   2,  -2,  -2,  -2 },
20966       {  1,   1,   0,  -4,   0 },
20967       {  2,   0,   0,  -2,   2 },
20968       {  0,   2,   2,  -2,   1 },
20969       {  1,   0,   2,   0,  -1 },
20970       {  2,   1,   0,  -2,   1 },
20971       {  2,  -1,  -2,   0,  -1 },
20972       {  1,  -1,  -2,  -2,  -1 },
20973 
20974    /* 211-220 */
20975       {  0,   1,  -2,   1,  -2 },
20976       {  1,   0,  -4,   2,  -2 },
20977       {  0,   1,   2,   2,   1 },
20978       {  3,   0,   0,   0,   1 },
20979       {  2,  -1,   2,   2,   2 },
20980       {  0,   1,  -2,  -4,  -2 },
20981       {  1,   0,  -2,  -3,  -2 },
20982       {  2,   0,   0,   0,   2 },
20983       {  1,  -1,   0,  -2,  -2 },
20984       {  2,   0,  -2,   2,  -1 },
20985 
20986    /* 221-230 */
20987       {  0,   2,  -2,   0,  -2 },
20988       {  3,   0,  -2,   0,  -1 },
20989       {  2,  -1,   2,   0,   1 },
20990       {  1,   0,  -2,  -1,  -2 },
20991       {  0,   0,   2,   0,   3 },
20992       {  2,   0,  -4,   0,  -2 },
20993       {  2,   1,   0,  -4,   0 },
20994       {  1,   1,  -2,   1,  -1 },
20995       {  0,   2,   2,   0,   2 },
20996       {  1,  -1,   2,  -2,   2 },
20997 
20998    /* 231-240 */
20999       {  1,  -1,   0,  -2,   1 },
21000       {  2,   1,   2,   0,   1 },
21001       {  1,   0,   2,  -4,   2 },
21002       {  1,   1,  -2,   0,  -1 },
21003       {  1,   1,   0,   2,   0 },
21004       {  1,   0,   0,  -3,   0 },
21005       {  2,   0,   2,  -1,   2 },
21006       {  0,   2,   0,   0,  -1 },
21007       {  2,  -1,   0,  -2,   0 },
21008       {  4,   0,   0,   0,   0 },
21009 
21010    /* 241-250 */
21011       {  2,   1,  -2,  -2,  -2 },
21012       {  0,   2,  -2,   2,   0 },
21013       {  1,   0,   2,   1,   1 },
21014       {  1,   0,  -1,   0,  -3 },
21015       {  3,  -1,   2,   0,   2 },
21016       {  2,   0,   2,  -2,   0 },
21017       {  1,  -2,   0,   0,   0 },
21018       {  2,   0,   0,   0,  -2 },
21019       {  1,   0,   0,   4,   0 },
21020       {  0,   1,   0,   1,   1 },
21021 
21022    /* 251-260 */
21023       {  1,   0,   2,   2,   0 },
21024       {  0,   1,   0,   2,  -1 },
21025       {  0,   1,   0,   1,  -1 },
21026       {  0,   0,   2,  -2,   3 },
21027       {  3,   1,   2,   0,   2 },
21028       {  1,   1,   2,   1,   2 },
21029       {  1,   1,  -2,   2,  -1 },
21030       {  2,  -1,   2,  -2,   2 },
21031       {  1,  -2,   2,   0,   2 },
21032       {  1,   0,   2,  -4,   0 },
21033 
21034    /* 261-270 */
21035       {  0,   0,   1,   0,   0 },
21036       {  1,   0,   2,  -3,   1 },
21037       {  1,  -2,   0,  -2,   0 },
21038       {  2,   0,   0,   2,  -1 },
21039       {  1,   1,   2,  -4,   1 },
21040       {  4,   0,   2,   0,   1 },
21041       {  0,   1,   2,   1,   1 },
21042       {  1,   2,   2,  -2,   2 },
21043       {  2,   0,   2,   1,   2 },
21044       {  2,   1,   2,  -2,   1 },
21045 
21046    /* 271-280 */
21047       {  1,   0,   2,  -1,   1 },
21048       {  1,   0,   4,  -2,   1 },
21049       {  1,  -1,   2,  -2,   1 },
21050       {  0,   1,   0,  -4,   0 },
21051       {  3,   0,  -2,  -2,  -2 },
21052       {  0,   0,   4,  -4,   2 },
21053       {  2,   0,  -4,  -2,  -2 },
21054       {  2,  -2,   0,  -2,  -1 },
21055       {  1,   0,   2,  -2,  -1 },
21056       {  2,   0,  -2,  -6,  -2 },
21057 
21058    /* 281-290 */
21059       {  1,   0,  -2,   1,  -2 },
21060       {  1,   0,  -2,   2,   1 },
21061       {  1,  -1,   0,   2,  -1 },
21062       {  1,   0,  -2,   1,   0 },
21063       {  2,  -1,   0,  -2,   1 },
21064       {  1,  -1,   0,   2,   1 },
21065       {  2,   0,  -2,  -2,   0 },
21066       {  1,   0,   2,  -3,   2 },
21067       {  0,   0,   0,   4,  -1 },
21068       {  2,  -1,   0,   0,   1 },
21069 
21070    /* 291-300 */
21071       {  2,   0,   4,  -2,   2 },
21072       {  0,   0,   2,   3,   2 },
21073       {  0,   1,   4,  -2,   2 },
21074       {  0,   1,  -2,   2,   1 },
21075       {  1,   1,   0,   2,   1 },
21076       {  1,   0,   0,   4,   1 },
21077       {  0,   0,   4,   0,   1 },
21078       {  2,   0,   0,  -3,   0 },
21079       {  1,   0,   0,  -1,  -2 },
21080       {  1,  -2,  -2,  -2,  -2 },
21081 
21082    /* 301-310 */
21083       {  3,   0,   0,   2,   0 },
21084       {  2,   0,   2,  -4,   2 },
21085       {  1,   1,  -2,  -4,  -1 },
21086       {  1,   0,  -2,  -6,  -2 },
21087       {  2,  -1,   0,   0,  -1 },
21088       {  2,  -1,   0,   2,   0 },
21089       {  0,   1,   2,  -2,  -1 },
21090       {  1,   1,   0,   1,   0 },
21091       {  1,   2,   0,  -2,  -1 },
21092       {  1,   0,   0,   1,  -1 },
21093 
21094    /* 311-320 */
21095       {  0,   0,   1,   0,   2 },
21096       {  3,   1,   2,  -2,   2 },
21097       {  1,   0,  -4,  -2,  -2 },
21098       {  1,   0,   2,   4,   1 },
21099       {  1,  -2,   2,   2,   2 },
21100       {  1,  -1,  -2,  -4,  -2 },
21101       {  0,   0,   2,  -4,   2 },
21102       {  0,   0,   2,  -3,   1 },
21103       {  2,   1,  -2,   0,   0 },
21104       {  3,   0,  -2,  -2,  -1 },
21105 
21106    /* 321-330 */
21107       {  2,   0,   2,   4,   2 },
21108       {  0,   0,   0,   0,   3 },
21109       {  2,  -1,  -2,  -2,  -2 },
21110       {  2,   0,   0,  -1,   0 },
21111       {  3,   0,   2,  -4,   2 },
21112       {  2,   1,   2,   2,   2 },
21113       {  0,   0,   3,   0,   3 },
21114       {  1,   1,   2,   2,   1 },
21115       {  2,   1,   0,   0,  -1 },
21116       {  1,   2,   0,  -2,   1 },
21117 
21118    /* 331-340 */
21119       {  3,   0,   2,   2,   1 },
21120       {  1,  -1,  -2,   2,  -2 },
21121       {  1,   1,   0,  -1,   0 },
21122       {  1,   2,   0,   0,   0 },
21123       {  1,   0,   4,   0,   2 },
21124       {  1,  -1,   2,   4,   2 },
21125       {  2,   1,   0,   0,   1 },
21126       {  1,   0,   0,   2,   2 },
21127       {  1,  -1,  -2,   2,   0 },
21128       {  0,   2,  -2,  -2,  -1 },
21129 
21130    /* 341-350 */
21131       {  2,   0,  -2,   0,   2 },
21132       {  5,   0,   2,   0,   2 },
21133       {  3,   0,  -2,  -6,  -2 },
21134       {  1,  -1,   2,  -1,   2 },
21135       {  3,   0,   0,  -4,  -1 },
21136       {  1,   0,   0,   1,   1 },
21137       {  1,   0,  -4,   2,  -1 },
21138       {  0,   1,   2,  -4,   1 },
21139       {  1,   2,   2,   0,   2 },
21140       {  0,   1,   0,  -2,  -2 },
21141 
21142    /* 351-360 */
21143       {  0,   0,   2,  -1,   0 },
21144       {  1,   0,   1,   0,   1 },
21145       {  0,   2,   0,  -2,   1 },
21146       {  3,   0,   2,   0,   0 },
21147       {  1,   1,  -2,   1,   0 },
21148       {  2,   1,  -2,  -4,  -1 },
21149       {  3,  -1,   0,   0,   0 },
21150       {  2,  -1,  -2,   0,   0 },
21151       {  4,   0,   2,  -2,   1 },
21152       {  2,   0,  -2,   2,   0 },
21153 
21154    /* 361-370 */
21155       {  1,   1,   2,  -2,   0 },
21156       {  1,   0,  -2,   4,  -1 },
21157       {  1,   0,  -2,  -2,   1 },
21158       {  2,   0,   2,  -4,   0 },
21159       {  1,   1,   0,  -2,  -2 },
21160       {  1,   1,  -2,  -2,   0 },
21161       {  1,   0,   1,  -2,   1 },
21162       {  2,  -1,  -2,  -4,  -2 },
21163       {  3,   0,  -2,   0,  -2 },
21164       {  0,   1,  -2,  -2,   0 },
21165 
21166    /* 371-380 */
21167       {  3,   0,   0,  -2,  -1 },
21168       {  1,   0,  -2,  -3,  -1 },
21169       {  0,   1,   0,  -4,  -1 },
21170       {  1,  -2,   2,  -2,   1 },
21171       {  0,   1,  -2,   1,  -1 },
21172       {  1,  -1,   0,   0,   2 },
21173       {  2,   0,   0,   1,   0 },
21174       {  1,  -2,   0,   2,   0 },
21175       {  1,   2,  -2,  -2,  -1 },
21176       {  0,   0,   4,  -4,   1 },
21177 
21178    /* 381-390 */
21179       {  0,   1,   2,   4,   2 },
21180       {  0,   1,  -4,   2,  -2 },
21181       {  3,   0,  -2,   0,   0 },
21182       {  2,  -1,   2,   2,   1 },
21183       {  0,   1,  -2,  -4,  -1 },
21184       {  4,   0,   2,   2,   2 },
21185       {  2,   0,  -2,  -3,  -2 },
21186       {  2,   0,   0,  -6,   0 },
21187       {  1,   0,   2,   0,   3 },
21188       {  3,   1,   0,   0,   0 },
21189 
21190    /* 391-400 */
21191       {  3,   0,   0,  -4,   1 },
21192       {  1,  -1,   2,   0,   0 },
21193       {  1,  -1,   0,  -4,   0 },
21194       {  2,   0,  -2,   2,  -2 },
21195       {  1,   1,   0,  -2,   2 },
21196       {  4,   0,   0,  -2,   0 },
21197       {  2,   2,   0,  -2,   0 },
21198       {  0,   1,   2,   0,   0 },
21199       {  1,   1,   0,  -4,   1 },
21200       {  1,   0,   0,  -4,  -2 },
21201 
21202    /* 401-410 */
21203       {  0,   0,   0,   1,   2 },
21204       {  3,   0,   0,   2,   1 },
21205       {  1,   1,   0,  -4,  -1 },
21206       {  0,   0,   2,   2,  -1 },
21207       {  1,   1,   2,   0,   0 },
21208       {  1,  -1,   2,  -4,   1 },
21209       {  1,   1,   0,   0,   2 },
21210       {  0,   0,   2,   6,   2 },
21211       {  4,   0,  -2,  -2,  -1 },
21212       {  2,   1,   0,  -4,  -1 },
21213 
21214    /* 411-420 */
21215       {  0,   0,   0,   3,   1 },
21216       {  1,  -1,  -2,   0,   0 },
21217       {  0,   0,   2,   1,   0 },
21218       {  1,   0,   0,   2,  -2 },
21219       {  3,  -1,   2,   2,   2 },
21220       {  3,  -1,   2,  -2,   2 },
21221       {  1,   0,   0,  -1,   2 },
21222       {  1,  -2,   2,  -2,   2 },
21223       {  0,   1,   0,   2,   2 },
21224       {  0,   1,  -2,  -1,  -2 },
21225 
21226    /* 421-430 */
21227       {  1,   1,  -2,   0,   0 },
21228       {  0,   2,   2,  -2,   0 },
21229       {  3,  -1,  -2,  -1,  -2 },
21230       {  1,   0,   0,  -6,   0 },
21231       {  1,   0,  -2,  -4,   0 },
21232       {  2,   1,   0,  -4,   1 },
21233       {  2,   0,   2,   0,  -1 },
21234       {  2,   0,  -4,   0,  -1 },
21235       {  0,   0,   3,   0,   2 },
21236       {  2,   1,  -2,  -2,  -1 },
21237 
21238    /* 431-440 */
21239       {  1,  -2,   0,   0,   1 },
21240       {  2,  -1,   0,  -4,   0 },
21241       {  0,   0,   0,   3,   0 },
21242       {  5,   0,   2,  -2,   2 },
21243       {  1,   2,  -2,  -4,  -2 },
21244       {  1,   0,   4,  -4,   2 },
21245       {  0,   0,   4,  -1,   2 },
21246       {  3,   1,   0,  -4,   0 },
21247       {  3,   0,   0,  -6,   0 },
21248       {  2,   0,   0,   2,   2 },
21249 
21250    /* 441-450 */
21251       {  2,  -2,   2,   0,   2 },
21252       {  1,   0,   0,  -3,   1 },
21253       {  1,  -2,  -2,   0,  -2 },
21254       {  1,  -1,  -2,  -3,  -2 },
21255       {  0,   0,   2,  -2,  -2 },
21256       {  2,   0,  -2,  -4,   0 },
21257       {  1,   0,  -4,   0,   0 },
21258       {  0,   1,   0,  -1,   0 },
21259       {  4,   0,   0,   0,  -1 },
21260       {  3,   0,   2,  -1,   2 },
21261 
21262    /* 451-460 */
21263       {  3,  -1,   2,   0,   1 },
21264       {  2,   0,   2,  -1,   1 },
21265       {  1,   2,   2,  -2,   1 },
21266       {  1,   1,   0,   2,  -1 },
21267       {  0,   2,   2,   0,   1 },
21268       {  3,   1,   2,   0,   1 },
21269       {  1,   1,   2,   1,   1 },
21270       {  1,   1,   0,  -1,   1 },
21271       {  1,  -2,   0,  -2,  -1 },
21272       {  4,   0,   0,  -4,   0 },
21273 
21274    /* 461-470 */
21275       {  2,   1,   0,   2,   0 },
21276       {  1,  -1,   0,   4,   0 },
21277       {  0,   1,   0,  -2,   2 },
21278       {  0,   0,   2,   0,  -2 },
21279       {  1,   0,  -1,   0,   1 },
21280       {  3,   0,   2,  -2,   0 },
21281       {  2,   0,   2,   2,   0 },
21282       {  1,   2,   0,  -4,   0 },
21283       {  1,  -1,   0,  -3,   0 },
21284       {  0,   1,   0,   4,   0 },
21285 
21286    /* 471 - 480 */
21287       {  0,   1,  -2,   0,   0 },
21288       {  2,   2,   2,  -2,   2 },
21289       {  0,   0,   0,   1,  -2 },
21290       {  0,   2,  -2,   0,  -1 },
21291       {  4,   0,   2,  -4,   2 },
21292       {  2,   0,  -4,   2,  -2 },
21293       {  2,  -1,  -2,   0,  -2 },
21294       {  1,   1,   4,  -2,   2 },
21295       {  1,   1,   2,  -4,   2 },
21296       {  1,   0,   2,   3,   2 },
21297 
21298    /* 481-490 */
21299       {  1,   0,   0,   4,  -1 },
21300       {  0,   0,   0,   4,   2 },
21301       {  2,   0,   0,   4,   0 },
21302       {  1,   1,  -2,   2,   0 },
21303       {  2,   1,   2,   1,   2 },
21304       {  2,   1,   2,  -4,   1 },
21305       {  2,   0,   2,   1,   1 },
21306       {  2,   0,  -4,  -2,  -1 },
21307       {  2,   0,  -2,  -6,  -1 },
21308       {  2,  -1,   2,  -1,   2 },
21309 
21310    /* 491-500 */
21311       {  1,  -2,   2,   0,   1 },
21312       {  1,  -2,   0,  -2,   1 },
21313       {  1,  -1,   0,  -4,  -1 },
21314       {  0,   2,   2,   2,   2 },
21315       {  0,   2,  -2,  -4,  -2 },
21316       {  0,   1,   2,   3,   2 },
21317       {  0,   1,   0,  -4,   1 },
21318       {  3,   0,   0,  -2,   1 },
21319       {  2,   1,  -2,   0,   1 },
21320       {  2,   0,   4,  -2,   1 },
21321 
21322    /* 501-510 */
21323       {  2,   0,   0,  -3,  -1 },
21324       {  2,  -2,   0,  -2,   1 },
21325       {  2,  -1,   2,  -2,   1 },
21326       {  1,   0,   0,  -6,  -1 },
21327       {  1,  -2,   0,   0,  -1 },
21328       {  1,  -2,  -2,  -2,  -1 },
21329       {  0,   1,   4,  -2,   1 },
21330       {  0,   0,   2,   3,   1 },
21331       {  2,  -1,   0,  -1,   0 },
21332       {  1,   3,   0,  -2,   0 },
21333 
21334    /* 511-520 */
21335       {  0,   3,   0,  -2,   0 },
21336       {  2,  -2,   2,  -2,   2 },
21337       {  0,   0,   4,  -2,   0 },
21338       {  4,  -1,   2,   0,   2 },
21339       {  2,   2,  -2,  -4,  -2 },
21340       {  4,   1,   2,   0,   2 },
21341       {  4,  -1,  -2,  -2,  -2 },
21342       {  2,   1,   0,  -2,  -2 },
21343       {  2,   1,  -2,  -6,  -2 },
21344       {  2,   0,   0,  -1,   1 },
21345 
21346    /* 521-530 */
21347       {  2,  -1,  -2,   2,  -1 },
21348       {  1,   1,  -2,   2,  -2 },
21349       {  1,   1,  -2,  -3,  -2 },
21350       {  1,   0,   3,   0,   3 },
21351       {  1,   0,  -2,   1,   1 },
21352       {  1,   0,  -2,   0,   2 },
21353       {  1,  -1,   2,   1,   2 },
21354       {  1,  -1,   0,   0,  -2 },
21355       {  1,  -1,  -4,   2,  -2 },
21356       {  0,   3,  -2,  -2,  -2 },
21357 
21358    /* 531-540 */
21359       {  0,   1,   0,   4,   1 },
21360       {  0,   0,   4,   2,   2 },
21361       {  3,   0,  -2,  -2,   0 },
21362       {  2,  -2,   0,   0,   0 },
21363       {  1,   1,   2,  -4,   0 },
21364       {  1,   1,   0,  -3,   0 },
21365       {  1,   0,   2,  -3,   0 },
21366       {  1,  -1,   2,  -2,   0 },
21367       {  0,   2,   0,   2,   0 },
21368       {  0,   0,   2,   4,   0 },
21369 
21370    /* 541-550 */
21371       {  1,   0,   1,   0,   0 },
21372       {  3,   1,   2,  -2,   1 },
21373       {  3,   0,   4,  -2,   2 },
21374       {  3,   0,   2,   1,   2 },
21375       {  3,   0,   0,   2,  -1 },
21376       {  3,   0,   0,   0,   2 },
21377       {  3,   0,  -2,   2,  -1 },
21378       {  2,   0,   4,  -4,   2 },
21379       {  2,   0,   2,  -3,   2 },
21380       {  2,   0,   0,   4,   1 },
21381 
21382    /* 551-560 */
21383       {  2,   0,   0,  -3,   1 },
21384       {  2,   0,  -4,   2,  -1 },
21385       {  2,   0,  -2,  -2,   1 },
21386       {  2,  -2,   2,   2,   2 },
21387       {  2,  -2,   0,  -2,  -2 },
21388       {  2,  -1,   0,   2,   1 },
21389       {  2,  -1,   0,   2,  -1 },
21390       {  1,   1,   2,   4,   2 },
21391       {  1,   1,   0,   1,   1 },
21392       {  1,   1,   0,   1,  -1 },
21393 
21394    /* 561-570 */
21395       {  1,   1,  -2,  -6,  -2 },
21396       {  1,   0,   0,  -3,  -1 },
21397       {  1,   0,  -4,  -2,  -1 },
21398       {  1,   0,  -2,  -6,  -1 },
21399       {  1,  -2,   2,   2,   1 },
21400       {  1,  -2,  -2,   2,  -1 },
21401       {  1,  -1,  -2,  -4,  -1 },
21402       {  0,   2,   0,   0,   2 },
21403       {  0,   1,   2,  -4,   2 },
21404       {  0,   1,  -2,   4,  -1 },
21405 
21406    /* 571-580 */
21407       {  5,   0,   0,   0,   0 },
21408       {  3,   0,   0,  -3,   0 },
21409       {  2,   2,   0,  -4,   0 },
21410       {  1,  -1,   2,   2,   0 },
21411       {  0,   1,   0,   3,   0 },
21412       {  4,   0,  -2,   0,  -1 },
21413       {  3,   0,  -2,  -6,  -1 },
21414       {  3,   0,  -2,  -1,  -1 },
21415       {  2,   1,   2,   2,   1 },
21416       {  2,   1,   0,   2,   1 },
21417 
21418    /* 581-590 */
21419       {  2,   0,   2,   4,   1 },
21420       {  2,   0,   2,  -6,   1 },
21421       {  2,   0,   2,  -2,  -1 },
21422       {  2,   0,   0,  -6,  -1 },
21423       {  2,  -1,  -2,  -2,  -1 },
21424       {  1,   2,   2,   0,   1 },
21425       {  1,   2,   0,   0,   1 },
21426       {  1,   0,   4,   0,   1 },
21427       {  1,   0,   2,  -6,   1 },
21428       {  1,   0,   2,  -4,  -1 },
21429 
21430    /* 591-600 */
21431       {  1,   0,  -1,  -2,  -1 },
21432       {  1,  -1,   2,   4,   1 },
21433       {  1,  -1,   2,  -3,   1 },
21434       {  1,  -1,   0,   4,   1 },
21435       {  1,  -1,  -2,   1,  -1 },
21436       {  0,   1,   2,  -2,   3 },
21437       {  3,   0,   0,  -2,   0 },
21438       {  1,   0,   1,  -2,   0 },
21439       {  0,   2,   0,  -4,   0 },
21440       {  0,   0,   2,  -4,   0 },
21441 
21442    /* 601-610 */
21443       {  0,   0,   1,  -1,   0 },
21444       {  0,   0,   0,   6,   0 },
21445       {  0,   2,   0,   0,  -2 },
21446       {  0,   1,  -2,   2,  -3 },
21447       {  4,   0,   0,   2,   0 },
21448       {  3,   0,   0,  -1,   0 },
21449       {  3,  -1,   0,   2,   0 },
21450       {  2,   1,   0,   1,   0 },
21451       {  2,   1,   0,  -6,   0 },
21452       {  2,  -1,   2,   0,   0 },
21453 
21454    /* 611-620 */
21455       {  1,   0,   2,  -1,   0 },
21456       {  1,  -1,   0,   1,   0 },
21457       {  1,  -1,  -2,  -2,   0 },
21458       {  0,   1,   2,   2,   0 },
21459       {  0,   0,   2,  -3,   0 },
21460       {  2,   2,   0,  -2,  -1 },
21461       {  2,  -1,  -2,   0,   1 },
21462       {  1,   2,   2,  -4,   1 },
21463       {  0,   1,   4,  -4,   2 },
21464       {  0,   0,   0,   3,   2 },
21465 
21466    /* 621-630 */
21467       {  5,   0,   2,   0,   1 },
21468       {  4,   1,   2,  -2,   2 },
21469       {  4,   0,  -2,  -2,   0 },
21470       {  3,   1,   2,   2,   2 },
21471       {  3,   1,   0,  -2,   0 },
21472       {  3,   1,  -2,  -6,  -2 },
21473       {  3,   0,   0,   0,  -2 },
21474       {  3,   0,  -2,  -4,  -2 },
21475       {  3,  -1,   0,  -3,   0 },
21476       {  3,  -1,   0,  -2,   0 },
21477 
21478    /* 631-640 */
21479       {  2,   1,   2,   0,   0 },
21480       {  2,   1,   2,  -4,   2 },
21481       {  2,   1,   2,  -2,   0 },
21482       {  2,   1,   0,  -3,   0 },
21483       {  2,   1,  -2,   0,  -2 },
21484       {  2,   0,   0,  -4,   2 },
21485       {  2,   0,   0,  -4,  -2 },
21486       {  2,   0,  -2,  -5,  -2 },
21487       {  2,  -1,   2,   4,   2 },
21488       {  2,  -1,   0,  -2,   2 },
21489 
21490    /* 641-650 */
21491       {  1,   3,  -2,  -2,  -2 },
21492       {  1,   1,   0,   0,  -2 },
21493       {  1,   1,   0,  -6,   0 },
21494       {  1,   1,  -2,   1,  -2 },
21495       {  1,   1,  -2,  -1,  -2 },
21496       {  1,   0,   2,   1,   0 },
21497       {  1,   0,   0,   3,   0 },
21498       {  1,   0,   0,  -4,   2 },
21499       {  1,   0,  -2,   4,  -2 },
21500       {  1,  -2,   0,  -1,   0 },
21501 
21502    /* 651-NFLS */
21503       {  0,   1,  -4,   2,  -1 },
21504       {  1,   0,  -2,   0,  -3 },
21505       {  0,   0,   4,  -4,   4 }
21506    };
21507     }
21508 
21509 
21510     /* Fundamental-argument multipliers:  planetary terms */
21511       private static final int mfapl[][] = {
21512 
21513        /* 1-10 */
21514           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21515           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -1 },
21516           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -2 },
21517           {  0,  0,  1, -1,  1,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21518           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  2 },
21519           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21520           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21521           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  0 },
21522           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21523           {  0,  0,  0,  0,  1,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
21524 
21525        /* 11-20 */
21526           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -1 },
21527           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2, -5,  0,  0,  0 },
21528           {  0,  0,  2, -2,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21529           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -2 },
21530           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -1,  0,  0,  0,  2 },
21531           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  3,  0,  0,  0, -2 },
21532           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -2 },
21533           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  3,  0,  0,  0,  2 },
21534           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21535           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21536 
21537        /* 21-30 */
21538           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
21539           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  2 },
21540           {  0,  0,  0,  0,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21541           {  0,  0,  0,  0,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21542           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21543           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  2 },
21544           {  0,  0,  1, -1,  1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21545           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21546           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  1 },
21547           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21548 
21549        /* 31-40 */
21550           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
21551           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21552           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  2 },
21553           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -2 },
21554           {  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
21555           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  1 },
21556           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21557           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21558           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
21559           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21560 
21561        /* 41-50 */
21562           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
21563           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -2 },
21564           {  0,  0,  1, -1,  0,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21565           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -2,  0,  0,  0,  2 },
21566           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -2 },
21567           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21568           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  2 },
21569           {  1,  0,  0,  0,  0,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21570           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21571           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  1,  0,  0,  0,  2 },
21572 
21573        /* 51-60 */
21574           {  0,  0,  1, -1,  1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21575           {  1,  0,  0,  0,  0,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
21576           {  0,  0,  2, -2,  0,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21577           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  2 },
21578           {  1,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21579           {  0,  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  2 },
21580           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1 },
21581           {  1,  0, -2,  0, -2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21582           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21583           {  0,  0,  2, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21584 
21585        /* 61-70 */
21586           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  2 },
21587           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0, -2 },
21588           {  0,  0,  1, -1,  1,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21589           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -2 },
21590           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  2 },
21591           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  2 },
21592           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -1 },
21593           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -1 },
21594           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -2 },
21595           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21596 
21597        /* 71-80 */
21598           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -2 },
21599           {  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0,  2 },
21600           {  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0, -2 },
21601           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -2 },
21602           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -2 },
21603           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  2 },
21604           {  0,  0,  1, -1,  1,  0,  0, -5,  8, -3,  0,  0,  0,  0 },
21605           {  0,  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  2 },
21606           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  2 },
21607           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
21608 
21609        /* 81-90 */
21610           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21611           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -1 },
21612           {  2,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21613           {  0,  0,  0,  0,  1,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21614           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -2,  5,  0,  0,  0 },
21615           {  1,  0,  0, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21616           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  2 },
21617           {  1,  0,  0,  0, -1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21618           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21619           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21620 
21621        /* 91-100 */
21622           {  1,  0,  0, -2,  0,  0, 19,-21,  3,  0,  0,  0,  0,  0 },
21623           {  0,  0,  0,  0,  1,  0, -8, 13,  0,  0,  0,  0,  0,  0 },
21624           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
21625           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -2 },
21626           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  2 },
21627           {  1,  0,  0,  0,  1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21628           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -1 },
21629           {  0,  0,  0,  0,  0,  0,  0,  6,-16,  4,  5,  0,  0, -2 },
21630           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -2 },
21631           {  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0, -2 },
21632 
21633        /* 101-110 */
21634           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0, -1 },
21635           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  1 },
21636           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21637           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, -1 },
21638           {  0,  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0 },
21639           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
21640           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21641           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  0 },
21642           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0 },
21643           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2,  0,  0,  0,  2 },
21644 
21645        /* 111-120 */
21646           {  0,  0,  0,  0,  1,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21647           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  2 },
21648           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21649           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21650           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -1 },
21651           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  2 },
21652           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  0 },
21653           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21654           {  2,  0,  0, -2,  0,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21655           {  0,  0,  1, -1,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21656 
21657        /* 121-130 */
21658           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1 },
21659           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21660           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0, -1 },
21661           {  0,  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0 },
21662           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -2 },
21663           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1,  0,  0,  0 },
21664           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -2 },
21665           {  0,  0,  1, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21666           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -2 },
21667           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21668 
21669        /* 131-140 */
21670           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -1 },
21671           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  0 },
21672           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1 },
21673           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0, -1 },
21674           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21675           {  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  2 },
21676           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -3,  0,  0,  0,  2 },
21677           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  1 },
21678           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  1 },
21679           {  0,  0,  0,  0,  1,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21680 
21681        /* 141-150 */
21682           {  1,  0,  0, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21683           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -1 },
21684           {  0,  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  2 },
21685           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  2 },
21686           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -2 },
21687           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -1 },
21688           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21689           {  0,  0,  1, -1,  1,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
21690           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0,  0 },
21691           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -1,  0,  0,  0,  2 },
21692 
21693        /* 151-160 */
21694           {  1,  0,  0, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21695           {  0,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21696           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -4, 10,  0,  0,  0 },
21697           {  0,  0,  0,  0,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21698           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21699           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0,  0 },
21700           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  2 },
21701           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0, -2 },
21702           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -2 },
21703           {  0,  0,  2, -2,  1,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
21704 
21705        /* 161-170 */
21706           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -1,  0,  0,  2 },
21707           {  0,  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  2 },
21708           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  2,  0 },
21709           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0, -1 },
21710           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -1 },
21711           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
21712           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  1 },
21713           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21714           {  0,  0,  2, -2,  1,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
21715           {  2,  0,  2,  0,  2,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21716 
21717        /* 171-180 */
21718           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -2 },
21719           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21720           {  1,  0,  0, -1, -1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21721           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -2 },
21722           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  0 },
21723           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  1 },
21724           {  1,  0,  2,  0,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21725           {  1,  0, -2,  0, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
21726           {  0,  0,  0,  0,  1,  0,  0, -2,  4,  0,  0,  0,  0,  0 },
21727           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0 },
21728 
21729        /* 181-190 */
21730           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  2 },
21731           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  1 },
21732           {  0,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21733           {  0,  0,  0,  0,  0,  0,  0,  1, -8,  3,  0,  0,  0, -2 },
21734           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -2 },
21735           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  3,  0,  0,  0,  2 },
21736           {  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
21737           {  0,  0,  1, -1,  1,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
21738           {  0,  0,  1, -1,  0,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21739           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  1 },
21740 
21741        /* 191-200 */
21742           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  0 },
21743           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -2 },
21744           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21745           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0 },
21746           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2, -5,  0,  0,  0 },
21747           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -1 },
21748           {  0,  0,  1, -1,  1,  0,  0, -9, 15,  0,  0,  0,  0,  0 },
21749           {  0,  0,  0,  0,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21750           {  0,  0,  0,  0,  1,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
21751           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0 },
21752 
21753        /* 201-210 */
21754           {  0,  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0, -2 },
21755           {  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  2 },
21756           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -1,  0,  0,  2 },
21757           {  2,  0,  0, -2,  1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21758           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0, -1 },
21759           {  0,  0,  1, -1,  1,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
21760           {  0,  0,  1, -1,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21761           {  0,  0,  1, -1,  1,  0,  8,-14,  0,  0,  0,  0,  0,  0 },
21762           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0 },
21763           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21764 
21765        /* 211-220 */
21766           {  0,  0,  0,  0,  1,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21767           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0 },
21768           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0,  0 },
21769           {  2,  0,  0, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21770           {  0,  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  2 },
21771           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1,  0,  0,  2 },
21772           {  2,  0, -1, -1,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
21773           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -2 },
21774           {  0,  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0 },
21775           {  0,  0,  1, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21776 
21777        /* 221-230 */
21778           {  2,  0,  0, -2,  0,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
21779           {  2,  0,  0, -2,  0,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
21780           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -1,  0,  0,  0,  0 },
21781           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  1 },
21782           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  1 },
21783           {  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  0,  2 },
21784           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21785           {  0,  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0 },
21786           {  0,  0,  0,  0,  0,  0,  3, -9,  4,  0,  0,  0,  0, -2 },
21787           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -2 },
21788 
21789        /* 231-240 */
21790           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0, -2 },
21791           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  1 },
21792           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -2 },
21793           {  0,  0,  0,  0,  0,  0,  3, -5,  4,  0,  0,  0,  0,  2 },
21794           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21795           {  2,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21796           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -2 },
21797           {  0,  0,  1, -1,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21798           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  2 },
21799           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0, -1 },
21800 
21801        /* 241-250 */
21802           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21803           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  1 },
21804           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0 },
21805           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21806           {  0,  0,  1, -1,  1,  0,  2, -4,  0, -3,  0,  0,  0,  0 },
21807           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
21808           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  2 },
21809           {  0,  0,  2, -2,  2,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
21810           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  0 },
21811           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -2,  0,  0,  0 },
21812 
21813        /* 251-260 */
21814           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1,  0,  0,  2 },
21815           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -2 },
21816           {  0,  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  2 },
21817           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -1 },
21818           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -1 },
21819           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  0 },
21820           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21821           {  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  2 },
21822           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  5,  0,  0,  2 },
21823           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  1 },
21824 
21825        /* 261-270 */
21826           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  2 },
21827           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2, -5,  0,  0,  2 },
21828           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
21829           {  2,  0,  0, -2, -1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21830           {  1,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21831           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0,  0 },
21832           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  2, -5,  0,  0,  2 },
21833           {  0,  0,  0,  0,  1,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
21834           {  0,  0,  2, -2,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21835           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21836 
21837        /* 271-280 */
21838           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21839           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  0 },
21840           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  1 },
21841           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -2 },
21842           {  0,  0,  0,  0,  0,  0,  0, 11,  0,  0,  0,  0,  0,  2 },
21843           {  0,  0,  0,  0,  0,  0,  0,  6,-15,  0,  0,  0,  0, -2 },
21844           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  1,  0,  0,  0,  2 },
21845           {  1,  0,  0, -1,  0,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21846           {  0,  0,  0,  0,  1,  0, -3,  7, -4,  0,  0,  0,  0,  0 },
21847           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -2,  0,  0,  0,  2 },
21848 
21849        /* 281-290 */
21850           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  1 },
21851           {  0,  0,  2, -2,  2,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21852           {  0,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21853           {  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  0,  2 },
21854           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  0 },
21855           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  2 },
21856           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0, -2 },
21857           {  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0 },
21858           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0,  0 },
21859           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0, -2 },
21860 
21861        /* 291-300 */
21862           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0, -2 },
21863           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21864           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21865           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  1 },
21866           {  0,  0,  0,  0,  0,  0,  9,-12,  0,  0,  0,  0,  0, -2 },
21867           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  1 },
21868           {  0,  0,  1, -1,  0,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21869           {  0,  0,  1, -1,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21870           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0, -1 },
21871           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -1 },
21872 
21873        /* 301-310 */
21874           {  0,  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  2 },
21875           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0, -2 },
21876           {  0,  0,  1, -1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21877           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -1 },
21878           {  0,  0,  1, -1, -1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21879           {  0,  0,  0,  0,  0,  0,  0,  1, -5,  0,  0,  0,  0, -2 },
21880           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
21881           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  0 },
21882           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
21883           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  2 },
21884 
21885        /* 311-320 */
21886           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0, -1 },
21887           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  3,  0,  0,  0 },
21888           {  0,  0,  0,  0,  1,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21889           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  2 },
21890           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  1 },
21891           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21892           {  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0, -2 },
21893           {  0,  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  2 },
21894           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  2 },
21895           {  0,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21896 
21897        /* 321-330 */
21898           {  0,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21899           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -3,  0,  0,  0,  2 },
21900           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  0 },
21901           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21902           {  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  0,  2 },
21903           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  2 },
21904           {  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0,  0, -2 },
21905           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  1 },
21906           {  0,  0,  2, -2,  1, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
21907           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  2,  0,  0 },
21908 
21909        /* 331-340 */
21910           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
21911           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21912           {  0,  0,  2, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21913           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0,  0 },
21914           {  0,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21915           {  0,  0,  2, -2,  1,  0,  0, -8, 11,  0,  0,  0,  0,  0 },
21916           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
21917           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  2,  0,  0,  0 },
21918           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  2 },
21919           {  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0,  0, -2 },
21920 
21921        /* 341-350 */
21922           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -1 },
21923           {  0,  0,  0,  0,  0,  0,  0,  5, -2,  0,  0,  0,  0,  2 },
21924           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2 },
21925           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0, -2 },
21926           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  0 },
21927           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  3,  0,  0,  0,  2 },
21928           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21929           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0, -1 },
21930           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -1 },
21931           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  1 },
21932 
21933        /* 351-360 */
21934           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -1 },
21935           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -1 },
21936           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  2 },
21937           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  2 },
21938           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0,  0 },
21939           {  2,  0,  0, -2, -1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
21940           {  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0, -2 },
21941           {  2,  0, -1, -1, -1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
21942           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0 },
21943           {  0,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
21944 
21945        /* 361-370 */
21946           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  4, -3,  0,  0,  0 },
21947           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0,  0 },
21948           {  2,  0,  0, -2,  1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
21949           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0, -2 },
21950           {  0,  0,  0,  0,  0,  0,  0,  6, -5,  0,  0,  0,  0,  2 },
21951           {  1,  0, -2, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21952           {  0,  0,  1, -1,  2,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21953           {  0,  0,  0,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21954           {  0,  0,  0,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21955           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  1 },
21956 
21957        /* 371-380 */
21958           {  0,  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  2 },
21959           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0, -2,  0,  0,  2 },
21960           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -2,  0,  0,  2 },
21961           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  1 },
21962           {  0,  0,  0,  0,  0,  0,  0,  1, -6,  0,  0,  0,  0, -2 },
21963           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  2 },
21964           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  2 },
21965           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
21966           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
21967           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  2 },
21968 
21969        /* 381-390 */
21970           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21971           {  0,  0,  0,  0,  1,  0,  0, -8, 15,  0,  0,  0,  0,  0 },
21972           {  2,  0,  0, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21973           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21974           {  1,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21975           {  1,  0, -1,  1, -1,  0,-18, 17,  0,  0,  0,  0,  0,  0 },
21976           {  0,  0,  2,  0,  2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21977           {  0,  0,  2,  0,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21978           {  0,  0,  2, -2, -1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21979           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21980 
21981        /* 391-400 */
21982           {  0,  0,  0,  0,  1,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
21983           {  0,  0,  0,  0,  0,  0,  8,-16,  0,  0,  0,  0,  0, -2 },
21984           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  0,  0,  2 },
21985           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2 },
21986           {  0,  0,  0,  0,  2,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
21987           {  2,  0, -1, -1, -2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21988           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -1 },
21989           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  4,  0,  0,  0 },
21990           {  0,  0,  0,  0,  0,  0,  0,  2,  2,  0,  0,  0,  0,  2 },
21991           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  4, -5,  0,  0,  0 },
21992 
21993        /* 401-410 */
21994           {  2,  0,  0, -2, -1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21995           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
21996           {  1,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
21997           {  1,  0,  0, -1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21998           {  1,  0, -1, -1, -1,  0, 20,-20,  0,  0,  0,  0,  0,  0 },
21999           {  0,  0,  2, -2,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22000           {  0,  0,  1, -1,  1,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
22001           {  0,  0,  1, -1,  1,  0, -2,  1,  0,  0,  0,  0,  0,  0 },
22002           {  0,  0,  0,  0,  1,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
22003           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1,  0,  0,  0 },
22004 
22005        /* 411-420 */
22006           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -1 },
22007           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  1 },
22008           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -1 },
22009           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  1 },
22010           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0,  0 },
22011           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0 },
22012           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -2 },
22013           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22014           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
22015           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0 },
22016 
22017        /* 421-430 */
22018           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22019           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0, -2 },
22020           {  0,  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0, -2 },
22021           {  1,  0,  0, -2,  0,  0, 20,-21,  0,  0,  0,  0,  0,  0 },
22022           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0,  0 },
22023           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  0 },
22024           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0 },
22025           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22026           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0, -2 },
22027           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0,  0 },
22028 
22029        /* 431-440 */
22030           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  2 },
22031           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0,  2 },
22032           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0, -2 },
22033           {  0,  0,  0,  0,  0,  0,  0,  2, -7,  0,  0,  0,  0, -2 },
22034           {  1,  0,  0, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22035           {  1,  0, -2,  0, -2,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22036           {  0,  0,  0,  0,  1,  0,  0, -9, 17,  0,  0,  0,  0,  0 },
22037           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -2 },
22038           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22039           {  1,  0, -1,  1, -1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22040 
22041        /* 441-450 */
22042           {  0,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22043           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22044           {  0,  0,  1, -1,  2,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22045           {  0,  0,  0,  0,  1,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
22046           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -1 },
22047           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -2 },
22048           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0,  0 },
22049           {  0,  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0, -2 },
22050           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -4,  0,  0,  0,  2 },
22051           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -5,  0,  0,  0, -2 },
22052 
22053        /* 451-460 */
22054           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -5,  0,  0,  0, -2 },
22055           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  5,  0,  0,  2 },
22056           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0, -2 },
22057           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  1 },
22058           {  1,  0,  0, -2,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22059           {  0,  0,  0,  0,  0,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
22060           {  2,  0,  2,  0,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22061           {  0,  0,  1, -1, -1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22062           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
22063           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0, -2 },
22064 
22065        /* 461-470 */
22066           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22067           {  0,  0,  2, -2,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22068           {  0,  0,  2, -2,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22069           {  0,  0,  2, -2,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22070           {  0,  0,  2, -2,  1,  0,  0, -3,  0,  3,  0,  0,  0,  0 },
22071           {  0,  0,  2, -2,  1,  0, -5,  5,  0,  0,  0,  0,  0,  0 },
22072           {  0,  0,  1, -1,  1,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22073           {  0,  0,  1, -1,  1,  0,  0, -4,  6,  0,  0,  0,  0,  0 },
22074           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0, -1,  0,  0 },
22075           {  0,  0,  1, -1,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
22076 
22077        /* 471-480 */
22078           {  0,  0,  0,  0,  1,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
22079           {  0,  0,  0,  0,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22080           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -1 },
22081           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  1 },
22082           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -2 },
22083           {  0,  0,  0,  0,  0,  0,  3, -8,  0,  0,  0,  0,  0, -2 },
22084           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -1 },
22085           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -1 },
22086           {  0,  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  2 },
22087           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  2 },
22088 
22089        /* 481-490 */
22090           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  2 },
22091           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0, -2 },
22092           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  1 },
22093           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  1 },
22094           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1 },
22095           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0, -1 },
22096           {  2,  0,  0, -2, -1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
22097           {  2,  0, -1, -1,  1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
22098           {  0,  0,  2, -2,  1,  0,  0, -7,  9,  0,  0,  0,  0,  0 },
22099           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -1 },
22100 
22101        /* 491-500 */
22102           {  0,  0,  1, -1,  2,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
22103           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22104           {  1,  0,  0, -2,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22105           {  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  0,  0 },
22106           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0 },
22107           {  2,  0,  0, -2,  1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
22108           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
22109           {  1,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22110           {  1,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22111           {  1,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22112 
22113        /* 501-510 */
22114           {  1,  0,  0, -1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22115           {  1,  0, -1,  0, -1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22116           {  0,  0,  2, -2,  1,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22117           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  0,  0,  0,  0 },
22118           {  0,  0,  2, -2,  1,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
22119           {  0,  0,  2, -2,  0,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
22120           {  0,  0,  1,  1,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22121           {  0,  0,  1, -1,  1,  0,  0,  1, -4,  0,  0,  0,  0,  0 },
22122           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1, -3,  0,  0,  0 },
22123           {  0,  0,  0,  0,  1,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
22124 
22125        /* 511-520 */
22126           {  0,  0,  0,  0,  1,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22127           {  0,  0,  0,  0,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22128           {  0,  0,  0,  0,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22129           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0,  0 },
22130           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -1 },
22131           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  1 },
22132           {  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  0,  1 },
22133           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -1 },
22134           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  0 },
22135           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  1 },
22136 
22137        /* 521-530 */
22138           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -1 },
22139           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0, -2 },
22140           {  0,  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  2 },
22141           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  1 },
22142           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0, -1 },
22143           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0 },
22144           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -1 },
22145           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  1 },
22146           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0 },
22147           {  2,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22148 
22149        /* 531-540 */
22150           {  2,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22151           {  1,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22152           {  1,  0,  0,  0,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22153           {  1,  0,  0,  0,  0,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22154           {  1,  0,  0, -2,  0,  0, 17,-16,  0, -2,  0,  0,  0,  0 },
22155           {  1,  0,  0, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22156           {  0,  0,  2, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22157           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0 },
22158           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  0,  0 },
22159           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -4,  0,  0,  0,  0 },
22160 
22161        /* 541-550 */
22162           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2, -2 },
22163           {  0,  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  2 },
22164           {  2,  0,  0, -2,  0,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22165           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  2,  0,  0,  0 },
22166           {  1,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22167           {  1,  0,  0,  0,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22168           {  1,  0,  0,  0,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22169           {  1,  0,  0, -2,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22170           {  1,  0,  0, -2,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22171           {  1,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22172 
22173        /* 551-560 */
22174           {  1,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22175           {  0,  0,  2, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22176           {  0,  0,  1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22177           {  0,  0,  1, -1,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22178           {  0,  0,  1, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22179           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22180           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22181           {  0,  0,  1, -1,  0,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
22182           {  0,  0,  1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22183           {  0,  0,  0,  2,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22184 
22185        /* 561-570 */
22186           {  0,  0,  0,  0,  0,  0,  8, -9,  0,  0,  0,  0,  0,  0 },
22187           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22188           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  0 },
22189           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0 },
22190           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0 },
22191           {  2,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22192           {  1,  0,  0,  0,  1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22193           {  1,  0,  0,  0, -1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22194           {  0,  0,  2,  0,  2,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
22195           {  0,  0,  2,  0,  2,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22196 
22197        /* 571-580 */
22198           {  0,  0,  2,  0,  2,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
22199           {  0,  0,  2,  0,  2,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22200           {  0,  0,  0,  0,  2,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
22201           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22202           {  2,  0,  2, -2,  2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22203           {  2,  0,  1, -3,  1,  0, -6,  7,  0,  0,  0,  0,  0,  0 },
22204           {  2,  0,  0, -2,  0,  0,  2, -5,  0,  0,  0,  0,  0,  0 },
22205           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  5, -5,  0,  0,  0 },
22206           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  1,  5,  0,  0,  0 },
22207           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
22208 
22209        /* 581-590 */
22210           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
22211           {  2,  0,  0, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22212           {  2,  0, -2,  0, -2,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
22213           {  2,  0, -1, -1,  0,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
22214           {  1,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22215           {  1,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22216           {  1,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22217           {  1,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22218           {  1,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22219           {  1,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22220 
22221        /* 591-600 */
22222           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22223           {  1,  0,  0, -2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22224           {  1,  0, -2, -2, -2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22225           {  1,  0, -1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22226           {  1,  0, -1, -1,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
22227           {  0,  0,  2,  2,  2,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22228           {  0,  0,  2, -2,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22229           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  1,  0,  0,  0,  0 },
22230           {  0,  0,  2, -2,  1,  0,  0,-10, 15,  0,  0,  0,  0,  0 },
22231           {  0,  0,  2, -2,  0, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
22232 
22233        /* 601-610 */
22234           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
22235           {  0,  0,  1, -1,  2,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22236           {  0,  0,  1, -1,  1,  0, -4,  6,  0,  0,  0,  0,  0,  0 },
22237           {  0,  0,  1, -1,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22238           {  0,  0,  1, -1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22239           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22240           {  0,  0,  1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22241           {  0,  0,  1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
22242           {  0,  0,  1, -1, -1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22243           {  0,  0,  0,  2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22244 
22245        /* 611-620 */
22246           {  0,  0,  0,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22247           {  0,  0,  0,  0,  2,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22248           {  0,  0,  0,  0,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22249           {  0,  0,  0,  0,  0,  0,  9,-13,  0,  0,  0,  0,  0, -2 },
22250           {  0,  0,  0,  0,  0,  0,  8,-14,  0,  0,  0,  0,  0, -2 },
22251           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -1 },
22252           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0,  0 },
22253           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0,  0 },
22254           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0, -1 },
22255           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -2 },
22256 
22257        /* 621-630 */
22258           {  0,  0,  0,  0,  0,  0,  5, -6, -4,  0,  0,  0,  0, -2 },
22259           {  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  0,  2 },
22260           {  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0, -2 },
22261           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0,  0 },
22262           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  2,  0,  0,  0,  2 },
22263           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  0 },
22264           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  0 },
22265           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -2 },
22266           {  0,  0,  0,  0,  0,  0,  0,  7,-12,  0,  0,  0,  0, -2 },
22267           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0, -2 },
22268 
22269        /* 631-640 */
22270           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  1,  5,  0,  0,  2 },
22271           {  0,  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  2 },
22272           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0 },
22273           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -4,  0,  0,  0,  2 },
22274           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -1 },
22275           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  2 },
22276           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0, -2 },
22277           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0 },
22278           {  0,  0,  0,  0,  0,  0,  0,  5,-16,  4,  5,  0,  0, -2 },
22279           {  0,  0,  0,  0,  0,  0,  0,  5,-13,  0,  0,  0,  0, -2 },
22280 
22281        /* 641-650 */
22282           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -5,  0,  0,  0, -2 },
22283           {  0,  0,  0,  0,  0,  0,  0,  3, -9,  0,  0,  0,  0, -2 },
22284           {  0,  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0, -2 },
22285           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2,  0,  0,  0,  2 },
22286           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -3,  0,  0,  0 },
22287           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  1,  5,  0,  0, -2 },
22288           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1, -5,  0,  0,  0 },
22289           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2,  0,  0,  2 },
22290           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -3,  0,  0,  0 },
22291           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0 },
22292 
22293        /* 651-NFPL */
22294           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0 },
22295           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -6,  3,  0, -2 },
22296           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0 },
22297           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0 },
22298           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2 },
22299           {  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0 }
22300        };
22301 
22302       /**
22303        *
22304        *  Time scale transformation:  Terrestrial Time, TT, to International
22305        *  Atomic Time, TAI.
22306        *
22307        * <p>This function is derived from the International Astronomical Union's
22308        *  SOFA (Standards of Fundamental Astronomy) software collection.
22309        *
22310        *<p>Status:  canonical.
22311        *
22312        *<!-- Given: -->
22313        *    @param tt1    double    TT as a 2-part Julian Date
22314        *    @param tt2    double    TT as a 2-part Julian Date
22315        *
22316        *<!-- Returned:-->
22317        *     @return   TAI as a 2-part Julian Date
22318        *
22319        *  Returned (function value):
22320        *                int       status:  0 = OK
22321        *
22322        *  Note:
22323        *
22324        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22325        *     the two arguments, for example where tt1 is the Julian Day Number
22326        *     and tt2 is the fraction of a day.  The returned tai1,tai2 follow
22327        *     suit.
22328        *
22329        *<p>References:
22330        *
22331        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22332        *     IERS Technical Note No. 32, BKG (2004)
22333        *
22334        *     Explanatory Supplement to the Astronomical Almanac,
22335        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22336        *
22337        *@version 2010 May 13
22338        *
22339        *@since SOFA release 2010-12-01
22340        *
22341        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22342        */
22343       public static JulianDate jauTttai(double tt1, double tt2)
22344       {
22345           double tai1, tai2;
22346           /* TT minus TAI (days). */
22347           final double dtat = TTMTAI / 86400.0;
22348 
22349 
22350           /* Result, safeguarding precision. */
22351           if ( abs(tt1) > abs(tt2) ) {
22352               tai1 = tt1;
22353               tai2 = tt2 - dtat;
22354           } else {
22355               tai1 = tt1 - dtat;
22356               tai2 = tt2;
22357           }
22358 
22359           return new JulianDate(tai1, tai2);
22360 
22361       };
22362 
22363       /**
22364        *
22365        *  Time scale transformation:  Terrestrial Time, TT, to Geocentric
22366        *  Coordinate Time, TCG.
22367        *
22368        * <p>This function is derived from the International Astronomical Union's
22369        *  SOFA (Standards of Fundamental Astronomy) software collection.
22370        *
22371        *<p>Status:  canonical.
22372        *
22373        *<!-- Given: -->
22374        *     @param tt1 double    TT as a 2-part Julian Date
22375        *     @param tt2 double    TT as a 2-part Julian Date
22376        *
22377        *<!-- Returned:-->
22378        *     @return   TCG as a 2-part Julian Date
22379        *
22380        *  Returned (function value):
22381        *                int       status:  0 = OK
22382        *
22383        *  Note:
22384        *
22385        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22386        *     the two arguments, for example where tt1 is the Julian Day Number
22387        *     and tt2 is the fraction of a day.  The returned tcg1,tcg2 follow
22388        *     suit.
22389        *
22390        *<p>References:
22391        *
22392        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22393        *     IERS Technical Note No. 32, BKG (2004)
22394        *
22395        *     IAU 2000 Resolution B1.9
22396        *
22397        *@version 2010 May 13
22398        *
22399        *@since SOFA release 2010-12-01
22400        *
22401        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22402        */
22403       public static JulianDate jauTttcg(double tt1, double tt2)
22404 
22405       {
22406           double tcg1, tcg2;
22407 
22408           /* 1977 Jan 1 00:00:32.184 TT, as MJD */
22409           final double t77t = DJM77 + TTMTAI/DAYSEC;
22410 
22411           /* TT to TCG rate */
22412           final double elgg = ELG/(1.0-ELG);
22413 
22414 
22415           /* Result, safeguarding precision. */
22416           if ( abs(tt1) > abs(tt2) ) {
22417               tcg1 = tt1;
22418               tcg2 = tt2 + ( ( tt1 - DJM0 ) + ( tt2 - t77t ) ) * elgg;
22419           } else {
22420               tcg1 = tt1 + ( ( tt2 - DJM0 ) + ( tt1 - t77t ) ) * elgg;
22421               tcg2 = tt2;
22422           }
22423 
22424           return new JulianDate(tcg1, tcg2);
22425 
22426       };      
22427 
22428       /**
22429        *
22430        *  Time scale transformation:  Terrestrial Time, TT, to Barycentric
22431        *  Dynamical Time, TDB.
22432        *
22433        * <p>This function is derived from the International Astronomical Union's
22434        *  SOFA (Standards of Fundamental Astronomy) software collection.
22435        *
22436        *<p>Status:  canonical.
22437        *
22438        *<!-- Given: -->
22439        *     @param tt1    double    TT as a 2-part Julian Date
22440        *     @param tt2    double    TT as a 2-part Julian Date
22441        *     @param dtr        double    TDB-TT in seconds
22442        *
22443        *<!-- Returned:-->
22444        *     @return   TDB as a 2-part Julian Date
22445        *
22446        *  Returned (function value):
22447        *                int       status:  0 = OK
22448        *
22449        *<p>Notes:
22450        *
22451        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22452        *     the two arguments, for example where tt1 is the Julian Day Number
22453        *     and tt2 is the fraction of a day.  The returned tdb1,tdb2 follow
22454        *     suit.
22455        *
22456        *  2  The argument dtr represents the quasi-periodic component of the
22457        *     GR transformation between TT and TCB.  It is dependent upon the
22458        *     adopted solar-system ephemeris, and can be obtained by numerical
22459        *     integration, by interrogating a precomputed time ephemeris or by
22460        *     evaluating a model such as that implemented in the SOFA function
22461        *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
22462        *     amplitude.
22463        *
22464        *  3  TDB is essentially the same as Teph, the time argument for the JPL
22465        *     solar system ephemerides.
22466        *
22467        *<p>References:
22468        *
22469        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22470        *     IERS Technical Note No. 32, BKG (2004)
22471        *
22472        *     IAU 2006 Resolution 3
22473        *
22474        *@version 2010 May 13
22475        *
22476        *@since SOFA release 2010-12-01
22477        *
22478        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22479        */
22480       public static JulianDate jauTttdb(double tt1, double tt2, double dtr)
22481       {
22482 
22483           double tdb1, tdb2;
22484           double dtrd;
22485 
22486 
22487           /* Result, safeguarding precision. */
22488           dtrd = dtr / DAYSEC;
22489           if ( abs(tt1) > abs(tt2) ) {
22490               tdb1 = tt1;
22491               tdb2 = tt2 + dtrd;
22492           } else {
22493               tdb1 = tt1 + dtrd;
22494               tdb2 = tt2;
22495           }
22496 
22497           return new JulianDate(tdb1, tdb2);
22498 
22499       };
22500 
22501       /**
22502        *
22503        *  Time scale transformation:  Terrestrial Time, TT, to Universal Time,
22504        *  UT1.
22505        *
22506        * <p>This function is derived from the International Astronomical Union's
22507        *  SOFA (Standards of Fundamental Astronomy) software collection.
22508        *
22509        *<p>Status:  canonical.
22510        *
22511        *<!-- Given: -->
22512        *    @param tt1    double    TT as a 2-part Julian Date
22513        *    @param tt2    double    TT as a 2-part Julian Date
22514        *    @param dt         double    TT-UT1 in seconds
22515        *
22516        *<!-- Returned:-->
22517        *     @return   UT1 as a 2-part Julian Date
22518        *
22519        *  Returned (function value):
22520        *                int       status:  0 = OK
22521        *
22522        *<p>Notes:
22523        *
22524        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22525        *     the two arguments, for example where tt1 is the Julian Day Number
22526        *     and tt2 is the fraction of a day.  The returned ut11,ut12 follow
22527        *     suit.
22528        *
22529        *  2  The argument dt is classical Delta T.
22530        *
22531        *  Reference:
22532        *
22533        *     Explanatory Supplement to the Astronomical Almanac,
22534        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22535        *
22536        *@version 2010 May 16
22537        *
22538        *@since SOFA release 2010-12-01
22539        *
22540        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22541        */
22542       public static JulianDate jauTtut1(double tt1, double tt2, double dt)
22543 
22544       {
22545 
22546           double ut11, ut12;
22547           double dtd;
22548 
22549 
22550           /* Result, safeguarding precision. */
22551           dtd = dt / DAYSEC;
22552           if ( abs(tt1) > abs(tt2) ) {
22553               ut11 = tt1;
22554               ut12 = tt2 - dtd;
22555           } else {
22556               ut11 = tt1 - dtd;
22557               ut12 = tt2;
22558           }
22559 
22560           return new JulianDate(ut11, ut12);
22561       };
22562 
22563       /**
22564        *
22565        *  Time scale transformation:  Universal Time, UT1, to International
22566        *  Atomic Time, TAI.
22567        *
22568        * <p>This function is derived from the International Astronomical Union's
22569        *  SOFA (Standards of Fundamental Astronomy) software collection.
22570        *
22571        *<p>Status:  canonical.
22572        *
22573        *<!-- Given: -->
22574        *   @param  ut11  double    UT1 as a 2-part Julian Date
22575        *   @param  ut12  double    UT1 as a 2-part Julian Date
22576        *   @param  dta        double    UT1-TAI in seconds
22577        *
22578        *<!-- Returned:-->
22579        *    @return    TAI as a 2-part Julian Date
22580        *
22581        *  Returned (function value):
22582        *                int       status:  0 = OK
22583        *
22584        *<p>Notes:
22585        *
22586        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22587        *     between the two arguments, for example where ut11 is the Julian
22588        *     Day Number and ut12 is the fraction of a day.  The returned
22589        *     TAI1,TAI2 follow suit.
22590        *
22591        *  2  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
22592        *     available from IERS tabulations.
22593        *
22594        *  Reference:
22595        *
22596        *     Explanatory Supplement to the Astronomical Almanac,
22597        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22598        *
22599        *@version 2010 May 16
22600        *
22601        *@since SOFA release 2010-12-01
22602        *
22603        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22604        */
22605       public static JulianDate jauUt1tai(double ut11, double ut12, double dta )
22606 
22607       {
22608           double tai1, tai2;
22609           double dtad;
22610 
22611 
22612           /* Result, safeguarding precision. */
22613           dtad = dta / DAYSEC;
22614           if ( abs(ut11) > abs(ut12) ) {
22615               tai1 = ut11;
22616               tai2 = ut12 - dtad;
22617           } else {
22618               tai1 = ut11 - dtad;
22619               tai2 = ut12;
22620           }
22621           return new JulianDate(tai1, tai2);
22622 
22623       };
22624 
22625       /**
22626        *
22627        *  Time scale transformation:  Universal Time, UT1, to Terrestrial
22628        *  Time, TT.
22629        *
22630        * <p>This function is derived from the International Astronomical Union's
22631        *  SOFA (Standards of Fundamental Astronomy) software collection.
22632        *
22633        *<p>Status:  canonical.
22634        *
22635        *<!-- Given: -->
22636        *   @param  ut11  double    UT1 as a 2-part Julian Date
22637        *   @param  ut12  double    UT1 as a 2-part Julian Date
22638        *   @param  dt         double    TT-UT1 in seconds
22639        *
22640        *<!-- Returned:-->
22641        *     @return    TAI as a 2-part Julian Date
22642        *
22643        *  Returned (function value):
22644        *                int       status:  0 = OK
22645        *
22646        *<p>Notes:
22647        *
22648        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22649        *     between the two arguments, for example where ut11 is the Julian
22650        *     Day Number and ut12 is the fraction of a day.  The returned
22651        *     tt1,tt2 follow suit.
22652        *
22653        *  2  The argument dt is classical Delta T.
22654        *
22655        *  Reference:
22656        *
22657        *     Explanatory Supplement to the Astronomical Almanac,
22658        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22659        *
22660        *@version 2010 May 16
22661        *
22662        *@since SOFA release 2010-12-01
22663        *
22664        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22665        */
22666       public static JulianDate jauUt1tt(double ut11, double ut12, double dt)
22667       {
22668 
22669           double tt1, tt2;
22670           double dtd;
22671 
22672 
22673           /* Result, safeguarding precision. */
22674           dtd = dt / DAYSEC;
22675           if ( abs(ut11) > abs(ut12) ) {
22676               tt1 = ut11;
22677               tt2 = ut12 + dtd;
22678           } else {
22679               tt1 = ut11 + dtd;
22680               tt2 = ut12;
22681           }
22682 
22683           return new JulianDate(tt1, tt2);
22684 
22685       };
22686 
22687       /**
22688        *
22689        *  Time scale transformation:  Universal Time, UT1, to Coordinated
22690        *  Universal Time, UTC.
22691        *
22692        * <p>This function is derived from the International Astronomical Union's
22693        *  SOFA (Standards of Fundamental Astronomy) software collection.
22694        *
22695        *<p>Status:  canonical.
22696        *
22697        *<!-- Given: -->
22698        *  @param ut11 double   UT1 as a 2-part Julian Date (Note 1)
22699        *  @param ut12 double   UT1 as a 2-part Julian Date (Note 1) 
22700        *  @param   dut1       double   Delta UT1: UT1-UTC in seconds (Note 2)
22701        *
22702        *<!-- Returned:-->
22703        *     @return  JulianDate   UTC as a 2-part quasi Julian Date (Notes 3,4)
22704        *
22705        *  Returned (function value):
22706        *                int      status: +1 = dubious year (Note 5)
22707        *                                  0 = OK
22708        *                                 -1 = unacceptable date
22709        *
22710        *<p>Notes:
22711        *<ol>
22712        *  <li>  ut11+ut12 is Julian Date, apportioned in any convenient way
22713        *     between the two arguments, for example where ut11 is the Julian
22714        *     Day Number and ut12 is the fraction of a day.  The returned utc1
22715        *     and utc2 form an analogous pair, except that a special convention
22716        *     is used, to deal with the problem of leap seconds - see Note 3.
22717        *
22718        *  <li> Delta UT1 can be obtained from tabulations provided by the
22719        *     International Earth Rotation and Reference Systems Service.  The
22720        *     value changes abruptly by 1s at a leap second;  however, close to
22721        *     a leap second the algorithm used here is tolerant of the "wrong"
22722        *     choice of value being made.
22723        *
22724        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22725        *     special measures are taken.  The convention in the present
22726        *     function is that the returned quasi JD day UTC1+UTC2 represents
22727        *     UTC days whether the length is 86399, 86400 or 86401 SI seconds.
22728        *
22729        *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
22730        *     into calendar date and clock time, including UTC leap second
22731        *     handling.
22732        *
22733        *  <li> The warning status "dubious year" flags UTCs that predate the
22734        *     introduction of the time scale and that are too far in the future
22735        *     to be trusted.  See jauDat for further details.
22736        *</ol>
22737        *  Called:
22738        *  <ul>
22739        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22740        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22741        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22742        *</ul>
22743        *<p>References:
22744        *
22745        *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22746        *     IERS Technical Note No. 32, BKG (2004)
22747        *
22748        *     <p>Explanatory Supplement to the Astronomical Almanac,
22749        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22750        *
22751        *@version 2010 May 16
22752        *
22753        *@since SOFA release 2010-12-01
22754        *
22755        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22756        * @throws JSOFAIllegalParameter 
22757        * @throws JSOFAInternalError an internal error has occured
22758        */
22759       public static JulianDate jauUt1utc(double ut11, double ut12, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
22760 
22761       {
22762 
22763           double utc1, utc2;
22764           boolean big1;
22765           int i;
22766           double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du;
22767 
22768 
22769           /* UT1-UTC in seconds. */
22770           duts = dut1;
22771 
22772           /* Put the two parts of the UT1 into big-first order. */
22773           big1 = ( abs(ut11) >= abs(ut12) );
22774           if ( big1 ) {
22775               u1 = ut11;
22776               u2 = ut12;
22777           } else {
22778               u1 = ut12;
22779               u2 = ut11;
22780           }
22781 
22782           /* See if the UT1 can possibly be in a leap-second day. */
22783           d1 = u1;
22784           dats1 = 0;
22785           for ( i = -1; i <= 3; i++ ) {
22786               d2 = u2 + (double) i;
22787               Calendar dt = jauJd2cal(d1, d2 );
22788               dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
22789               if ( i == - 1 ) dats1 = dats2;
22790               ddats = dats2 - dats1;
22791               if ( abs(ddats) >= 0.5 ) {
22792 
22793                   /* Yes, leap second nearby: ensure UT1-UTC is "before" value. */
22794                   if ( ddats * duts >= 0 ) duts -= ddats;
22795 
22796                   /* UT1 for the start of the UTC day that ends in a leap. */
22797                   JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
22798                   d1 = jd.djm0; d2 = jd.djm1;
22799                   us1 = d1;
22800                   us2 = d2 - 1.0 + duts/DAYSEC;
22801 
22802                   /* Is the UT1 after this point? */
22803                   du = u1 - us1;
22804                   du += u2 - us2;
22805                   if ( du > 0 ) {
22806 
22807                       /* Yes:  fraction of the current UTC day that has elapsed. */
22808                       fd = du * DAYSEC / ( DAYSEC + ddats );
22809 
22810                       /* Ramp UT1-UTC to bring about SOFA's JD(UTC) convention. */
22811                       duts += ddats * ( fd <= 1.0 ? fd : 1.0 );
22812                   }
22813 
22814                   /* Done. */
22815                   break;
22816               }
22817               dats1 = dats2;
22818           }
22819 
22820           /* Subtract the (possibly adjusted) UT1-UTC from UT1 to give UTC. */
22821           u2 -= duts / DAYSEC;
22822 
22823           /* Result, safeguarding precision. */
22824           if ( big1 ) {
22825               utc1 = u1;
22826               utc2 = u2;
22827           } else {
22828               utc1 = u2;
22829               utc2 = u1;
22830           }
22831 
22832           /* FIXME Status. */
22833           return new JulianDate(utc1, utc2);
22834 
22835       };
22836 
22837       /**
22838        *
22839        *  Time scale transformation:  Coordinated Universal Time, UTC, to
22840        *  International Atomic Time, TAI.
22841        *
22842        * <p>This function is derived from the International Astronomical Union's
22843        *  SOFA (Standards of Fundamental Astronomy) software collection.
22844        *
22845        *<p>Status:  canonical.
22846        *
22847        *<!-- Given: -->
22848        *     @param utc1 double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22849        *     @param utc2 double   UTC as a 2-part quasi Julian Date (Notes 1-4) 
22850        *
22851        *<!-- Returned:-->
22852        *     @return JulianDate     TAI as a 2-part Julian Date (Note 5)
22853        *
22854        *  Returned (function value):
22855        *                int      status: +1 = dubious year (Note 3)
22856        *                                  0 = OK
22857        *                                 -1 = unacceptable date
22858        *
22859        *<p>Notes:
22860        *<ol>
22861        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
22862        *     convenient way between the two arguments, for example where utc1
22863        *     is the Julian Day Number and utc2 is the fraction of a day.
22864        *
22865        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22866        *     special measures are taken.  The convention in the present
22867        *     function is that the JD day represents UTC days whether the
22868        *     length is 86399, 86400 or 86401 SI seconds.
22869        *
22870        *  <li> The warning status "dubious year" flags UTCs that predate the
22871        *     introduction of the time scale and that are too far in the future
22872        *     to be trusted.  See jauDat  for further details.
22873        *
22874        *  <li> The function jauDtf2d converts from calendar date and time of day
22875        *     into 2-part Julian Date, and in the case of UTC implements the
22876        *     leap-second-ambiguity convention described above.
22877        *
22878        *  <li> The returned TAI1,TAI2 are such that their sum is the TAI Julian
22879        *     Date.
22880        *</ol>
22881        *  Called:<ul>
22882        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22883        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22884        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22885        *</ul>
22886        *<p>References:
22887        *
22888        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22889        *     IERS Technical Note No. 32, BKG (2004)
22890        *
22891        *     Explanatory Supplement to the Astronomical Almanac,
22892        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22893        *
22894        *@version 2010 September 10
22895        *
22896        *@since SOFA release 2010-12-01
22897        *
22898        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22899      * @throws JSOFAInternalError an internal error has occured
22900      * @throws JSOFAIllegalParameter 
22901        *
22902        */
22903       public static JulianDate jauUtctai(double utc1, double utc2) throws JSOFAIllegalParameter, JSOFAInternalError
22904 
22905       {
22906           double tai1, tai2;
22907           boolean big1;
22908           double u1, u2,  dats,  datst, ddat, a2, fd;
22909 
22910 
22911           /* Put the two parts of the UTC into big-first order. */
22912           big1 = ( abs(utc1) >= abs(utc2) );
22913           if ( big1 ) {
22914               u1 = utc1;
22915               u2 = utc2;
22916           } else {
22917               u1 = utc2;
22918               u2 = utc1;
22919           }
22920 
22921           /* Get TAI-UTC now. */
22922           Calendar dt = jauJd2cal(u1, u2 );
22923           dats = jauDat(dt.iy, dt.im, dt.id, dt.fd);
22924  //         if ( js < 0 ) return -1;
22925           fd = dt.fd;
22926           /* Get TAI-UTC tomorrow. */
22927           Calendar dtt = jauJd2cal(u1+1.5, u2-fd );
22928           datst = jauDat(dtt.iy, dtt.im, dtt.id, dtt.fd);
22929 //          if ( js < 0 ) return -1;
22930 
22931           /* If today ends in a leap second, scale the fraction into SI days. */
22932           ddat = datst - dats;
22933           if ( abs(ddat) > 0.5 ) fd += fd * ddat / DAYSEC;
22934 
22935           /* Today's calendar date to 2-part JD. */
22936           JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id ) ;
22937 
22938           /* Assemble the TAI result, preserving the UTC split and order. */
22939           a2 = jd.djm0 - u1;
22940           a2 += jd.djm1;
22941           a2 += fd + dats / DAYSEC;
22942           if ( big1 ) {
22943               tai1 = u1;
22944               tai2 = a2;
22945           } else {
22946               tai1 = a2;
22947               tai2 = u1;
22948           }
22949 
22950           /* FIXME Status. */
22951           return new JulianDate(tai1, tai2);
22952 
22953       };
22954 
22955       /**
22956        *
22957        *  Time scale transformation:  Coordinated Universal Time, UTC, to
22958        *  Universal Time, UT1.
22959        *
22960        * <p>This function is derived from the International Astronomical Union's
22961        *  SOFA (Standards of Fundamental Astronomy) software collection.
22962        *
22963        *<p>Status:  canonical.
22964        *
22965        *<!-- Given: -->
22966        *   @param  utc1  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22967        *   @param  utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22968        *   @param  dut1       double   Delta UT1 = UT1-UTC in seconds (Note 5)
22969        *
22970        *<!-- Returned:-->
22971        *     @return UT1 as a 2-part Julian Date (Note 6)
22972        *
22973        *  Returned (function value):
22974        *                int      status: +1 = dubious year (Note 7)
22975        *                                  0 = OK
22976        *                                 -1 = unacceptable date
22977        *
22978        *<p>Notes:
22979        *<ol>
22980        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
22981        *     convenient way between the two arguments, for example where utc1
22982        *     is the Julian Day Number and utc2 is the fraction of a day.
22983        *
22984        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22985        *     special measures are taken.  The convention in the present
22986        *     function is that the JD day represents UTC days whether the
22987        *     length is 86399, 86400 or 86401 SI seconds.
22988        *
22989        *  <li> The warning status "dubious year" flags UTCs that predate the
22990        *     introduction of the time scale and that are too far in the future
22991        *     to be trusted.  See jauDat  for further details.
22992        *
22993        *  <li> The function jauDtf2d  converts from calendar date and time of
22994        *     day into 2-part Julian Date, and in the case of UTC implements
22995        *     the leap-second-ambiguity convention described above.
22996        *
22997        *  <li> Delta UT1 can be obtained from tabulations provided by the
22998        *     International Earth Rotation and Reference Systems Service.  It
22999        *     It is the caller's responsibility to supply a DUT argument
23000        *     containing the UT1-UTC value that matches the given UTC.
23001        *
23002        *  <li> The returned ut11,ut12 are such that their sum is the UT1 Julian
23003        *     Date.
23004        *
23005        *  <li> The warning status "dubious year" flags UTCs that predate the
23006        *     introduction of the time scale and that are too far in the future
23007        *     to be trusted.  See jauDat for further details.
23008        *</ol>
23009        *<p>References:
23010        *
23011        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
23012        *     IERS Technical Note No. 32, BKG (2004)
23013        *
23014        *     Explanatory Supplement to the Astronomical Almanac,
23015        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
23016        *
23017        *  Called:<ul>
23018        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
23019        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
23020        *     <li>{@link #jauUtctai}    UTC to TAI
23021        *     <li>{@link #jauTaiut1}    TAI to UT1
23022        *</ul>
23023        *@version 2010 May 16
23024        *
23025        *@since SOFA release 2010-12-01
23026        *
23027        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
23028      * @throws JSOFAInternalError an internal error has occured
23029      * @throws JSOFAIllegalParameter 
23030        */
23031       public static JulianDate jauUtcut1(double utc1, double utc2, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
23032       {
23033 
23034     
23035           double dta;
23036           /* Look up TAI-UTC. */
23037           Calendar dt = jauJd2cal(utc1, utc2) ;
23038           double dat = jauDat ( dt.iy, dt.im, dt.id, 0.0 );
23039      
23040 
23041           /* Form UT1-TAI. */
23042           dta = dut1 - dat;
23043 
23044           /* UTC to TAI to UT1. */
23045           JulianDate tai = jauUtctai(utc1, utc2);
23046           return jauTaiut1(tai.djm0, tai.djm1, dta) ;
23047 
23048       };
23049 
23050       
23051     public static CelestialIntermediatePole jauXy06(double date1, double date2)
23052     /**
23053     *  X,Y coordinates of celestial intermediate pole from series based
23054     *  on IAU 2006 precession and IAU 2000A nutation.
23055     *
23056     *<p>This function is derived from the International Astronomical Union's
23057     *  SOFA (Standards Of Fundamental Astronomy) software collection.
23058     *
23059     *<p>Status:  canonical model.
23060     *
23061     *<!-- Given: -->
23062     *     @param date1 double TT as a 2-part Julian Date (Note 1)
23063     *     @param date2 double TT as a 2-part Julian Date (Note 1)
23064     *
23065     *<!-- Returned: -->
23066     *     @return  CIP X,Y coordinates (Note 2)
23067     *
23068     * <p>Notes:
23069     * <ol>
23070     *
23071     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
23072     *     convenient way between the two arguments.  For example,
23073     *     JD(TT)=2450123.7 could be expressed in any of these ways,
23074     *     among others:
23075     *<pre>
23076     *            date1          date2
23077     *
23078     *         2450123.7           0.0       (JD method)
23079     *         2451545.0       -1421.3       (J2000 method)
23080     *         2400000.5       50123.2       (MJD method)
23081     *         2450123.5           0.2       (date &amp; time method)
23082     *</pre>
23083     *     The JD method is the most natural and convenient to use in
23084     *     cases where the loss of several decimal digits of resolution
23085     *     is acceptable.  The J2000 method is best matched to the way
23086     *     the argument is handled internally and will deliver the
23087     *     optimum resolution.  The MJD method and the date &amp; time methods
23088     *     are both good compromises between resolution and convenience.
23089     *
23090     * <li> The X,Y coordinates are those of the unit vector towards the
23091     *     celestial intermediate pole.  They represent the combined effects
23092     *     of frame bias, precession and nutation.
23093     *
23094     * <li> The fundamental arguments used are as adopted in IERS Conventions
23095     *     (2003) and are from Simon et al. (1994) and Souchay et al.
23096     *     (1999).
23097     *
23098     * <li> This is an alternative to the angles-based method, via the JSOFA
23099     *     function jauFw2xy and as used in jauXys06a for example.  The two
23100     *     methods agree at the 1 microarcsecond level (at present), a
23101     *     negligible amount compared with the intrinsic accuracy of the
23102     *     models.  However, it would be unwise to mix the two methods
23103     *     (angles-based and series-based) in a single application.
23104     *</ol>
23105     *<p>Called:<ul>
23106     *     <li>{@link #jauFal03} mean anomaly of the Moon
23107     *     <li>{@link #jauFalp03} mean anomaly of the Sun
23108     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
23109     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
23110     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
23111     *     <li>{@link #jauFame03} mean longitude of Mercury
23112     *     <li>{@link #jauFave03} mean longitude of Venus
23113     *     <li>{@link #jauFae03} mean longitude of Earth
23114     *     <li>{@link #jauFama03} mean longitude of Mars
23115     *     <li>{@link #jauFaju03} mean longitude of Jupiter
23116     *     <li>{@link #jauFasa03} mean longitude of Saturn
23117     *     <li>{@link #jauFaur03} mean longitude of Uranus
23118     *     <li>{@link #jauFane03} mean longitude of Neptune
23119     *     <li>{@link #jauFapa03} general accumulated precession in longitude
23120     * </ul>
23121     *<p>References:
23122     *
23123     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003,
23124     *     Astron.Astrophys., 412, 567
23125     *
23126     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
23127     *
23128     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
23129     *     IERS Technical Note No. 32, BKG
23130     *
23131     *     Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
23132     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 1994, 282, 663
23133     *
23134     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., 1999,
23135     *     Astron.Astrophys.Supp.Ser. 135, 111
23136     *
23137     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
23138     *
23139     *@version 2009 October 16
23140     *
23141     *  @since Release 20101201
23142     *
23143     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
23144     */
23145     {
23146 
23147     /* Maximum power of T in the polynomials for X and Y */
23148        final int MAXPT = (5);
23149 
23150     /* Polynomial coefficients (arcsec, X then Y). */
23151        final double xyp[][] = {
23152 
23153           {    -0.016617,
23154              2004.191898,
23155                -0.4297829,
23156                -0.19861834,
23157                 0.000007578,
23158                 0.0000059285
23159           },
23160           {    -0.006951,
23161                -0.025896,
23162               -22.4072747,
23163                 0.00190059,
23164                 0.001112526,
23165                 0.0000001358
23166           }
23167        };
23168 
23169     /* N.B mfals defined as class static (outside this method) to avoid problems with 65535 byte limit for methods */ 
23170     /* Number of frequencies:  luni-solar */
23171         final int NFLS = mfals.length;
23172 
23173     /* Number of frequencies:  planetary */
23174        final int NFPL =mfapl.length ;
23175 
23176     /* Pointers into amplitudes array, one pointer per frequency */
23177        final int nc[] = {
23178 
23179        /* 1-100 */
23180            1,    21,    37,    51,    65,    79,    91,   103,   115,   127,
23181          139,   151,   163,   172,   184,   196,   207,   219,   231,   240,
23182          252,   261,   273,   285,   297,   309,   318,   327,   339,   351,
23183          363,   372,   384,   396,   405,   415,   423,   435,   444,   452,
23184          460,   467,   474,   482,   490,   498,   506,   513,   521,   528,
23185          536,   543,   551,   559,   566,   574,   582,   590,   597,   605,
23186          613,   620,   628,   636,   644,   651,   658,   666,   674,   680,
23187          687,   695,   702,   710,   717,   725,   732,   739,   746,   753,
23188          760,   767,   774,   782,   790,   798,   805,   812,   819,   826,
23189          833,   840,   846,   853,   860,   867,   874,   881,   888,   895,
23190 
23191        /* 101-200 */
23192          901,   908,   914,   921,   928,   934,   941,   948,   955,   962,
23193          969,   976,   982,   989,   996,  1003,  1010,  1017,  1024,  1031,
23194         1037,  1043,  1050,  1057,  1064,  1071,  1078,  1084,  1091,  1098,
23195         1104,  1112,  1118,  1124,  1131,  1138,  1145,  1151,  1157,  1164,
23196         1171,  1178,  1185,  1192,  1199,  1205,  1212,  1218,  1226,  1232,
23197         1239,  1245,  1252,  1259,  1266,  1272,  1278,  1284,  1292,  1298,
23198         1304,  1310,  1316,  1323,  1329,  1335,  1341,  1347,  1353,  1359,
23199         1365,  1371,  1377,  1383,  1389,  1396,  1402,  1408,  1414,  1420,
23200         1426,  1434,  1440,  1446,  1452,  1459,  1465,  1471,  1477,  1482,
23201         1488,  1493,  1499,  1504,  1509,  1514,  1520,  1527,  1532,  1538,
23202 
23203        /* 201-300 */
23204         1543,  1548,  1553,  1558,  1564,  1569,  1574,  1579,  1584,  1589,
23205         1594,  1596,  1598,  1600,  1602,  1605,  1608,  1610,  1612,  1617,
23206         1619,  1623,  1625,  1627,  1629,  1632,  1634,  1640,  1642,  1644,
23207         1646,  1648,  1650,  1652,  1654,  1658,  1660,  1662,  1664,  1668,
23208         1670,  1672,  1673,  1675,  1679,  1681,  1683,  1684,  1686,  1688,
23209         1690,  1693,  1695,  1697,  1701,  1703,  1705,  1707,  1709,  1711,
23210         1712,  1715,  1717,  1721,  1723,  1725,  1727,  1729,  1731,  1733,
23211         1735,  1737,  1739,  1741,  1743,  1745,  1747,  1749,  1751,  1753,
23212         1755,  1757,  1759,  1761,  1762,  1764,  1766,  1768,  1769,  1771,
23213         1773,  1775,  1777,  1779,  1781,  1783,  1785,  1787,  1788,  1790,
23214 
23215        /* 301-400 */
23216         1792,  1794,  1796,  1798,  1800,  1802,  1804,  1806,  1807,  1809,
23217         1811,  1815,  1817,  1819,  1821,  1823,  1825,  1827,  1829,  1831,
23218         1833,  1835,  1837,  1839,  1840,  1842,  1844,  1848,  1850,  1852,
23219         1854,  1856,  1858,  1859,  1860,  1862,  1864,  1866,  1868,  1869,
23220         1871,  1873,  1875,  1877,  1879,  1881,  1883,  1885,  1887,  1889,
23221         1891,  1892,  1896,  1898,  1900,  1901,  1903,  1905,  1907,  1909,
23222         1910,  1911,  1913,  1915,  1919,  1921,  1923,  1927,  1929,  1931,
23223         1933,  1935,  1937,  1939,  1943,  1945,  1947,  1948,  1949,  1951,
23224         1953,  1955,  1957,  1958,  1960,  1962,  1964,  1966,  1968,  1970,
23225         1971,  1973,  1974,  1975,  1977,  1979,  1980,  1981,  1982,  1984,
23226 
23227        /* 401-500 */
23228         1986,  1988,  1990,  1992,  1994,  1995,  1997,  1999,  2001,  2003,
23229         2005,  2007,  2008,  2009,  2011,  2013,  2015,  2017,  2019,  2021,
23230         2023,  2024,  2025,  2027,  2029,  2031,  2033,  2035,  2037,  2041,
23231         2043,  2045,  2046,  2047,  2049,  2051,  2053,  2055,  2056,  2057,
23232         2059,  2061,  2063,  2065,  2067,  2069,  2070,  2071,  2072,  2074,
23233         2076,  2078,  2080,  2082,  2084,  2086,  2088,  2090,  2092,  2094,
23234         2095,  2096,  2097,  2099,  2101,  2105,  2106,  2107,  2108,  2109,
23235         2110,  2111,  2113,  2115,  2119,  2121,  2123,  2125,  2127,  2129,
23236         2131,  2133,  2135,  2136,  2137,  2139,  2141,  2143,  2145,  2147,
23237         2149,  2151,  2153,  2155,  2157,  2159,  2161,  2163,  2165,  2167,
23238 
23239        /* 501-600 */
23240         2169,  2171,  2173,  2175,  2177,  2179,  2181,  2183,  2185,  2186,
23241         2187,  2188,  2192,  2193,  2195,  2197,  2199,  2201,  2203,  2205,
23242         2207,  2209,  2211,  2213,  2217,  2219,  2221,  2223,  2225,  2227,
23243         2229,  2231,  2233,  2234,  2235,  2236,  2237,  2238,  2239,  2240,
23244         2241,  2244,  2246,  2248,  2250,  2252,  2254,  2256,  2258,  2260,
23245         2262,  2264,  2266,  2268,  2270,  2272,  2274,  2276,  2278,  2280,
23246         2282,  2284,  2286,  2288,  2290,  2292,  2294,  2296,  2298,  2300,
23247         2302,  2303,  2304,  2305,  2306,  2307,  2309,  2311,  2313,  2315,
23248         2317,  2319,  2321,  2323,  2325,  2327,  2329,  2331,  2333,  2335,
23249         2337,  2341,  2343,  2345,  2347,  2349,  2351,  2352,  2355,  2356,
23250 
23251        /* 601-700 */
23252         2357,  2358,  2359,  2361,  2363,  2364,  2365,  2366,  2367,  2368,
23253         2369,  2370,  2371,  2372,  2373,  2374,  2376,  2378,  2380,  2382,
23254         2384,  2385,  2386,  2387,  2388,  2389,  2390,  2391,  2392,  2393,
23255         2394,  2395,  2396,  2397,  2398,  2399,  2400,  2401,  2402,  2403,
23256         2404,  2405,  2406,  2407,  2408,  2409,  2410,  2411,  2412,  2413,
23257         2414,  2415,  2417,  2418,  2430,  2438,  2445,  2453,  2460,  2468,
23258         2474,  2480,  2488,  2496,  2504,  2512,  2520,  2527,  2535,  2543,
23259         2550,  2558,  2566,  2574,  2580,  2588,  2596,  2604,  2612,  2619,
23260         2627,  2634,  2642,  2648,  2656,  2664,  2671,  2679,  2685,  2693,
23261         2701,  2709,  2717,  2725,  2733,  2739,  2747,  2753,  2761,  2769,
23262 
23263        /* 701-800 */
23264         2777,  2785,  2793,  2801,  2809,  2817,  2825,  2833,  2841,  2848,
23265         2856,  2864,  2872,  2878,  2884,  2892,  2898,  2906,  2914,  2922,
23266         2930,  2938,  2944,  2952,  2958,  2966,  2974,  2982,  2988,  2996,
23267         3001,  3009,  3017,  3025,  3032,  3039,  3045,  3052,  3059,  3067,
23268         3069,  3076,  3083,  3090,  3098,  3105,  3109,  3111,  3113,  3120,
23269         3124,  3128,  3132,  3136,  3140,  3144,  3146,  3150,  3158,  3161,
23270         3165,  3166,  3168,  3172,  3176,  3180,  3182,  3185,  3189,  3193,
23271         3194,  3197,  3200,  3204,  3208,  3212,  3216,  3219,  3221,  3222,
23272         3226,  3230,  3234,  3238,  3242,  3243,  3247,  3251,  3254,  3258,
23273         3262,  3266,  3270,  3274,  3275,  3279,  3283,  3287,  3289,  3293,
23274 
23275        /* 801-900 */
23276         3296,  3300,  3303,  3307,  3311,  3315,  3319,  3321,  3324,  3327,
23277         3330,  3334,  3338,  3340,  3342,  3346,  3350,  3354,  3358,  3361,
23278         3365,  3369,  3373,  3377,  3381,  3385,  3389,  3393,  3394,  3398,
23279         3402,  3406,  3410,  3413,  3417,  3421,  3425,  3429,  3433,  3435,
23280         3439,  3443,  3446,  3450,  3453,  3457,  3458,  3461,  3464,  3468,
23281         3472,  3476,  3478,  3481,  3485,  3489,  3493,  3497,  3501,  3505,
23282         3507,  3511,  3514,  3517,  3521,  3524,  3525,  3527,  3529,  3533,
23283         3536,  3540,  3541,  3545,  3548,  3551,  3555,  3559,  3563,  3567,
23284         3569,  3570,  3574,  3576,  3578,  3582,  3586,  3590,  3593,  3596,
23285         3600,  3604,  3608,  3612,  3616,  3620,  3623,  3626,  3630,  3632,
23286 
23287        /* 901-1000 */
23288         3636,  3640,  3643,  3646,  3648,  3652,  3656,  3660,  3664,  3667,
23289         3669,  3671,  3675,  3679,  3683,  3687,  3689,  3693,  3694,  3695,
23290         3699,  3703,  3705,  3707,  3710,  3713,  3717,  3721,  3725,  3729,
23291         3733,  3736,  3740,  3744,  3748,  3752,  3754,  3757,  3759,  3763,
23292         3767,  3770,  3773,  3777,  3779,  3783,  3786,  3790,  3794,  3798,
23293         3801,  3805,  3809,  3813,  3817,  3821,  3825,  3827,  3831,  3835,
23294         3836,  3837,  3840,  3844,  3848,  3852,  3856,  3859,  3863,  3867,
23295         3869,  3871,  3875,  3879,  3883,  3887,  3890,  3894,  3898,  3901,
23296         3905,  3909,  3913,  3917,  3921,  3922,  3923,  3924,  3926,  3930,
23297         3932,  3936,  3938,  3940,  3944,  3948,  3952,  3956,  3959,  3963,
23298 
23299        /* 1001-1100 */
23300         3965,  3969,  3973,  3977,  3979,  3981,  3982,  3986,  3989,  3993,
23301         3997,  4001,  4004,  4006,  4009,  4012,  4016,  4020,  4024,  4026,
23302         4028,  4032,  4036,  4040,  4044,  4046,  4050,  4054,  4058,  4060,
23303         4062,  4063,  4064,  4068,  4071,  4075,  4077,  4081,  4083,  4087,
23304         4089,  4091,  4095,  4099,  4101,  4103,  4105,  4107,  4111,  4115,
23305         4119,  4123,  4127,  4129,  4131,  4135,  4139,  4141,  4143,  4145,
23306         4149,  4153,  4157,  4161,  4165,  4169,  4173,  4177,  4180,  4183,
23307         4187,  4191,  4195,  4198,  4201,  4205,  4209,  4212,  4213,  4216,
23308         4217,  4221,  4223,  4226,  4230,  4234,  4236,  4240,  4244,  4248,
23309         4252,  4256,  4258,  4262,  4264,  4266,  4268,  4270,  4272,  4276,
23310 
23311        /* 1101-1200 */
23312         4279,  4283,  4285,  4287,  4289,  4293,  4295,  4299,  4300,  4301,
23313         4305,  4309,  4313,  4317,  4319,  4323,  4325,  4329,  4331,  4333,
23314         4335,  4337,  4341,  4345,  4349,  4351,  4353,  4357,  4361,  4365,
23315         4367,  4369,  4373,  4377,  4381,  4383,  4387,  4389,  4391,  4395,
23316         4399,  4403,  4407,  4411,  4413,  4414,  4415,  4418,  4419,  4421,
23317         4423,  4427,  4429,  4431,  4433,  4435,  4437,  4439,  4443,  4446,
23318         4450,  4452,  4456,  4458,  4460,  4462,  4466,  4469,  4473,  4477,
23319         4481,  4483,  4487,  4489,  4491,  4493,  4497,  4499,  4501,  4504,
23320         4506,  4510,  4513,  4514,  4515,  4518,  4521,  4522,  4525,  4526,
23321         4527,  4530,  4533,  4534,  4537,  4541,  4542,  4543,  4544,  4545,
23322 
23323        /* 1201-1300 */
23324         4546,  4547,  4550,  4553,  4554,  4555,  4558,  4561,  4564,  4567,
23325         4568,  4571,  4574,  4575,  4578,  4581,  4582,  4585,  4586,  4588,
23326         4590,  4592,  4596,  4598,  4602,  4604,  4608,  4612,  4613,  4616,
23327         4619,  4622,  4623,  4624,  4625,  4626,  4629,  4632,  4633,  4636,
23328         4639,  4640,  4641,  4642,  4643,  4644,  4645,  4648,  4649,  4650,
23329         4651,  4652,  4653,  4656,  4657,  4660,  4661,  4664,  4667,  4670,
23330         4671,  4674,  4675,  4676,  4677,  4678,  4681,  4682,  4683,  4684,
23331         4687,  4688,  4689,  4692,  4693,  4696,  4697,  4700,  4701,  4702,
23332         4703,  4704,  4707,  4708,  4711,  4712,  4715,  4716,  4717,  4718,
23333         4719,  4720,  4721,  4722,  4723,  4726,  4729,  4730,  4733,  4736,
23334 
23335        /* 1301-(NFLS+NFPL) */
23336         4737,  4740,  4741,  4742,  4745,  4746,  4749,  4752,  4753
23337        };
23338 
23339     /* Amplitude coefficients (microarcsec);  indexed using the nc array. */
23340        final double a[] = {
23341 
23342        /* 1-105 */
23343              -6844318.44,     9205236.26,1328.67,1538.18,      205833.11,
23344                153041.79,       -3309.73, 853.32,2037.98,       -2301.27,
23345            81.46, 120.56, -20.39, -15.22,   1.73,  -1.61,  -0.10,   0.11,
23346            -0.02,  -0.02,     -523908.04,      573033.42,-544.75,-458.66,
23347                 12814.01,       11714.49, 198.97,-290.91, 155.74,-143.27,
23348            -2.75,  -1.03,  -1.27,  -1.16,   0.00,  -0.01,      -90552.22,
23349                 97846.69, 111.23, 137.41,2187.91,2024.68,  41.44, -51.26,
23350            26.92, -24.46,  -0.46,  -0.28,  -0.22,  -0.20,       82168.76,
23351                -89618.24, -27.64, -29.05,       -2004.36,       -1837.32,
23352           -36.07,  48.00, -24.43,  22.41,   0.47,   0.24,   0.20,   0.18,
23353                 58707.02,7387.02, 470.05,-192.40, 164.33,       -1312.21,
23354          -179.73, -28.93, -17.36,  -1.83,  -0.50,   3.57,   0.00,   0.13,
23355                -20557.78,       22438.42, -20.84, -17.40, 501.82, 459.68,
23356            59.20, -67.30,   6.08,  -5.61,  -1.36,  -1.19,       28288.28,
23357          -674.99, -34.69,  35.80, -15.07,-632.54, -11.19,   0.78,  -8.41,
23358             0.17,   0.01,   0.07,      -15406.85,       20069.50,  15.12,
23359 
23360        /* 106-219 */
23361            31.80, 448.76, 344.50,  -5.77,   1.41,   4.59,  -5.02,   0.17,
23362             0.24,      -11991.74,       12902.66,  32.46,  36.70, 288.49,
23363           268.14,   5.70,  -7.06,   3.57,  -3.23,  -0.06,  -0.04,
23364                 -8584.95,       -9592.72,   4.42, -13.20,-214.50, 192.06,
23365            23.87,  29.83,   2.54,   2.40,   0.60,  -0.48,5095.50,
23366                 -6918.22,   7.19,   3.92,-154.91,-113.94,   2.86,  -1.04,
23367            -1.52,   1.73,  -0.07,  -0.10,       -4910.93,       -5331.13,
23368             0.76,   0.40,-119.21, 109.81,   2.16,   3.20,   1.46,   1.33,
23369             0.04,  -0.02,       -6245.02,-123.48,  -6.68,  -8.20,  -2.76,
23370           139.64,   2.71,   0.15,   1.86,2511.85,       -3323.89,   1.07,
23371            -0.90, -74.33, -56.17,   1.16,  -0.01,  -0.75,   0.83,  -0.02,
23372            -0.04,2307.58,3143.98,  -7.52,   7.50,  70.31, -51.60,   1.46,
23373             0.16,  -0.69,  -0.79,   0.02,  -0.05,2372.58,2554.51,   5.93,
23374            -6.60,  57.12, -53.05,  -0.96,  -1.24,  -0.71,  -0.64,  -0.01,
23375                 -2053.16,2636.13,   5.13,   7.80,  58.94,  45.91,  -0.42,
23376            -0.12,   0.61,  -0.66,   0.02,   0.03,       -1825.49,
23377 
23378        /* 220-339 */
23379                 -2423.59,   1.23,  -2.00, -54.19,  40.82,  -1.07,  -1.02,
23380             0.54,   0.61,  -0.04,   0.04,2521.07,-122.28,  -5.97,   2.90,
23381            -2.73, -56.37,  -0.82,   0.13,  -0.75,       -1534.09,1645.01,
23382             6.29,   6.80,  36.78,  34.30,   0.92,  -1.25,   0.46,  -0.41,
23383            -0.02,  -0.01,1898.27,  47.70,  -0.72,   2.50,   1.07, -42.45,
23384            -0.94,   0.02,  -0.56,       -1292.02,       -1387.00,   0.00,
23385             0.00, -31.01,  28.89,   0.68,   0.00,   0.38,   0.35,  -0.01,
23386            -0.01,       -1234.96,1323.81,   5.21,   5.90,  29.60,  27.61,
23387             0.74,  -1.22,   0.37,  -0.33,  -0.02,  -0.01,1137.48,
23388                 -1233.89,  -0.04,  -0.30, -27.59, -25.43,  -0.61,   1.00,
23389            -0.34,   0.31,   0.01,   0.01,-813.13,       -1075.60,   0.40,
23390             0.30, -24.05,  18.18,  -0.40,  -0.01,   0.24,   0.27,  -0.01,
23391             0.01,1163.22, -60.90,  -2.94,   1.30,  -1.36, -26.01,  -0.58,
23392             0.07,  -0.35,1029.70, -55.55,  -2.63,   1.10,  -1.25, -23.02,
23393            -0.52,   0.06,  -0.31,-556.26, 852.85,   3.16,  -4.48,  19.06,
23394            12.44,  -0.81,  -0.27,   0.17,  -0.21,   0.00,   0.02,-603.52,
23395 
23396        /* 340-467 */
23397          -800.34,   0.44,   0.10, -17.90,  13.49,  -0.08,  -0.01,   0.18,
23398             0.20,  -0.01,   0.01,-628.24, 684.99,  -0.64,  -0.50,  15.32,
23399            14.05,   3.18,  -4.19,   0.19,  -0.17,  -0.09,  -0.07,-866.48,
23400           -16.26,   0.52,  -1.30,  -0.36,  19.37,   0.43,  -0.01,   0.26,
23401          -512.37, 695.54,  -1.47,  -1.40,  15.55,  11.46,  -0.16,   0.03,
23402             0.15,  -0.17,   0.01,   0.01, 506.65, 643.75,   2.54,  -2.62,
23403            14.40, -11.33,  -0.77,  -0.06,  -0.15,  -0.16,   0.00,   0.01,
23404           664.57,  16.81,  -0.40,   1.00,   0.38, -14.86,  -3.71,  -0.09,
23405            -0.20, 405.91, 522.11,   0.99,  -1.50,  11.67,  -9.08,  -0.25,
23406            -0.02,  -0.12,  -0.13,-305.78, 326.60,   1.75,   1.90,   7.30,
23407             6.84,   0.20,  -0.04, 300.99,-325.03,  -0.44,  -0.50,  -7.27,
23408            -6.73,  -1.01,   0.01,   0.00,   0.08,   0.00,   0.02, 438.51,
23409            10.47,  -0.56,  -0.20,   0.24,  -9.81,  -0.24,   0.01,  -0.13,
23410          -264.02, 335.24,   0.99,   1.40,   7.49,   5.90,  -0.27,  -0.02,
23411           284.09, 307.03,   0.32,  -0.40,   6.87,  -6.35,  -0.99,  -0.01,
23412          -250.54, 327.11,   0.08,   0.40,   7.31,   5.60,  -0.30, 230.72,
23413 
23414        /* 468-595 */
23415          -304.46,   0.08,  -0.10,  -6.81,  -5.16,   0.27, 229.78, 304.17,
23416            -0.60,   0.50,   6.80,  -5.14,   0.33,   0.01, 256.30,-276.81,
23417            -0.28,  -0.40,  -6.19,  -5.73,  -0.14,   0.01,-212.82, 269.45,
23418             0.84,   1.20,   6.02,   4.76,   0.14,  -0.02, 196.64, 272.05,
23419            -0.84,   0.90,   6.08,  -4.40,   0.35,   0.02, 188.95, 272.22,
23420            -0.12,   0.30,   6.09,  -4.22,   0.34,-292.37,  -5.10,  -0.32,
23421            -0.40,  -0.11,   6.54,   0.14,   0.01, 161.79,-220.67,   0.24,
23422             0.10,  -4.93,  -3.62,  -0.08, 261.54, -19.94,  -0.95,   0.20,
23423            -0.45,  -5.85,  -0.13,   0.02, 142.16,-190.79,   0.20,   0.10,
23424            -4.27,  -3.18,  -0.07, 187.95,  -4.11,  -0.24,   0.30,  -0.09,
23425            -4.20,  -0.09,   0.01,   0.00,   0.00, -79.08, 167.90,   0.04,
23426             0.00,   3.75,   1.77, 121.98, 131.04,  -0.08,   0.10,   2.93,
23427            -2.73,  -0.06,-172.95,  -8.11,  -0.40,  -0.20,  -0.18,   3.87,
23428             0.09,   0.01,-160.15, -55.30, -14.04,  13.90,  -1.23,   3.58,
23429             0.40,   0.31,-115.40, 123.20,   0.60,   0.70,   2.75,   2.58,
23430             0.08,  -0.01,-168.26,  -2.00,   0.20,  -0.20,  -0.04,   3.76,
23431 
23432        /* 596-723 */
23433             0.08,-114.49, 123.20,   0.32,   0.40,   2.75,   2.56,   0.07,
23434            -0.01, 112.14, 120.70,   0.28,  -0.30,   2.70,  -2.51,  -0.07,
23435            -0.01, 161.34,   4.03,   0.20,   0.20,   0.09,  -3.61,  -0.08,
23436            91.31, 126.64,  -0.40,   0.40,   2.83,  -2.04,  -0.04,   0.01,
23437           105.29, 112.90,   0.44,  -0.50,   2.52,  -2.35,  -0.07,  -0.01,
23438            98.69,-106.20,  -0.28,  -0.30,  -2.37,  -2.21,  -0.06,   0.01,
23439            86.74,-112.94,  -0.08,  -0.20,  -2.53,  -1.94,  -0.05,-134.81,
23440             3.51,   0.20,  -0.20,   0.08,   3.01,   0.07,  79.03, 107.31,
23441            -0.24,   0.20,   2.40,  -1.77,  -0.04,   0.01, 132.81, -10.77,
23442            -0.52,   0.10,  -0.24,  -2.97,  -0.07,   0.01,-130.31,  -0.90,
23443             0.04,   0.00,   0.00,   2.91, -78.56,  85.32,   0.00,   0.00,
23444             1.91,   1.76,   0.04,   0.00,   0.00, -41.53,  89.10,   0.02,
23445             0.00,   1.99,   0.93,  66.03, -71.00,  -0.20,  -0.20,  -1.59,
23446            -1.48,  -0.04,  60.50,  64.70,   0.36,  -0.40,   1.45,  -1.35,
23447            -0.04,  -0.01, -52.27, -70.01,   0.00,   0.00,  -1.57,   1.17,
23448             0.03, -52.95,  66.29,   0.32,   0.40,   1.48,   1.18,   0.04,
23449 
23450        /* 724-851 */
23451            -0.01,  51.02,  67.25,   0.00,   0.00,   1.50,  -1.14,  -0.03,
23452           -55.66, -60.92,   0.16,  -0.20,  -1.36,   1.24,   0.03, -54.81,
23453           -59.20,  -0.08,   0.20,  -1.32,   1.23,   0.03,  51.32, -55.60,
23454             0.00,   0.00,  -1.24,  -1.15,  -0.03,  48.29,  51.80,   0.20,
23455            -0.20,   1.16,  -1.08,  -0.03, -45.59, -49.00,  -0.12,   0.10,
23456            -1.10,   1.02,   0.03,  40.54, -52.69,  -0.04,  -0.10,  -1.18,
23457            -0.91,  -0.02, -40.58, -49.51,  -1.00,   1.00,  -1.11,   0.91,
23458             0.04,   0.02, -43.76,  46.50,   0.36,   0.40,   1.04,   0.98,
23459             0.03,  -0.01,  62.65,  -5.00,  -0.24,   0.00,  -0.11,  -1.40,
23460            -0.03,   0.01, -38.57,  49.59,   0.08,   0.10,   1.11,   0.86,
23461             0.02, -33.22, -44.04,   0.08,  -0.10,  -0.98,   0.74,   0.02,
23462            37.15, -39.90,  -0.12,  -0.10,  -0.89,  -0.83,  -0.02,  36.68,
23463           -39.50,  -0.04,  -0.10,  -0.88,  -0.82,  -0.02, -53.22,  -3.91,
23464            -0.20,   0.00,  -0.09,   1.19,   0.03,  32.43, -42.19,  -0.04,
23465            -0.10,  -0.94,  -0.73,  -0.02, -51.00,  -2.30,  -0.12,  -0.10,
23466             0.00,   1.14, -29.53, -39.11,   0.04,   0.00,  -0.87,   0.66,
23467 
23468        /* 852-979 */
23469             0.02,  28.50, -38.92,  -0.08,  -0.10,  -0.87,  -0.64,  -0.02,
23470            26.54,  36.95,  -0.12,   0.10,   0.83,  -0.59,  -0.01,  26.54,
23471            34.59,   0.04,  -0.10,   0.77,  -0.59,  -0.02,  28.35, -32.55,
23472            -0.16,   0.20,  -0.73,  -0.63,  -0.01, -28.00,  30.40,   0.00,
23473             0.00,   0.68,   0.63,   0.01, -27.61,  29.40,   0.20,   0.20,
23474             0.66,   0.62,   0.02,  40.33,   0.40,  -0.04,   0.10,   0.00,
23475            -0.90, -23.28,  31.61,  -0.08,  -0.10,   0.71,   0.52,   0.01,
23476            37.75,   0.80,   0.04,   0.10,   0.00,  -0.84,  23.66,  25.80,
23477             0.00,   0.00,   0.58,  -0.53,  -0.01,  21.01, -27.91,   0.00,
23478             0.00,  -0.62,  -0.47,  -0.01, -34.81,   2.89,   0.04,   0.00,
23479             0.00,   0.78, -23.49, -25.31,   0.00,   0.00,  -0.57,   0.53,
23480             0.01, -23.47,  25.20,   0.16,   0.20,   0.56,   0.52,   0.02,
23481            19.58,  27.50,  -0.12,   0.10,   0.62,  -0.44,  -0.01, -22.67,
23482           -24.40,  -0.08,   0.10,  -0.55,   0.51,   0.01, -19.97,  25.00,
23483             0.12,   0.20,   0.56,   0.45,   0.01,  21.28, -22.80,  -0.08,
23484            -0.10,  -0.51,  -0.48,  -0.01, -30.47,   0.91,   0.04,   0.00,
23485 
23486        /* 980-1107 */
23487             0.00,   0.68,  18.58,  24.00,   0.04,  -0.10,   0.54,  -0.42,
23488            -0.01, -18.02,  24.40,  -0.04,  -0.10,   0.55,   0.40,   0.01,
23489            17.74,  22.50,   0.08,  -0.10,   0.50,  -0.40,  -0.01, -19.41,
23490            20.70,   0.08,   0.10,   0.46,   0.43,   0.01, -18.64,  20.11,
23491             0.00,   0.00,   0.45,   0.42,   0.01, -16.75,  21.60,   0.04,
23492             0.10,   0.48,   0.37,   0.01, -18.42, -20.00,   0.00,   0.00,
23493            -0.45,   0.41,   0.01, -26.77,   1.41,   0.08,   0.00,   0.00,
23494             0.60, -26.17,  -0.19,   0.00,   0.00,   0.00,   0.59, -15.52,
23495            20.51,   0.00,   0.00,   0.46,   0.35,   0.01, -25.42,  -1.91,
23496            -0.08,   0.00,  -0.04,   0.57,   0.45, -17.42,  18.10,   0.00,
23497             0.00,   0.40,   0.39,   0.01,  16.39, -17.60,  -0.08,  -0.10,
23498            -0.39,  -0.37,  -0.01, -14.37,  18.91,   0.00,   0.00,   0.42,
23499             0.32,   0.01,  23.39,  -2.40,  -0.12,   0.00,   0.00,  -0.52,
23500            14.32, -18.50,  -0.04,  -0.10,  -0.41,  -0.32,  -0.01,  15.69,
23501            17.08,   0.00,   0.00,   0.38,  -0.35,  -0.01, -22.99,   0.50,
23502             0.04,   0.00,   0.00,   0.51,   0.00,   0.00,  14.47, -17.60,
23503 
23504        /* 1108-1235 */
23505            -0.01,   0.00,  -0.39,  -0.32, -13.33,  18.40,  -0.04,  -0.10,
23506             0.41,   0.30,  22.47,  -0.60,  -0.04,   0.00,   0.00,  -0.50,
23507           -12.78, -17.41,   0.04,   0.00,  -0.39,   0.29,   0.01, -14.10,
23508           -15.31,   0.04,   0.00,  -0.34,   0.32,   0.01,  11.98,  16.21,
23509            -0.04,   0.00,   0.36,  -0.27,  -0.01,  19.65,  -1.90,  -0.08,
23510             0.00,   0.00,  -0.44,  19.61,  -1.50,  -0.08,   0.00,   0.00,
23511            -0.44,  13.41, -14.30,  -0.04,  -0.10,  -0.32,  -0.30,  -0.01,
23512           -13.29,  14.40,   0.00,   0.00,   0.32,   0.30,   0.01,  11.14,
23513           -14.40,  -0.04,   0.00,  -0.32,  -0.25,  -0.01,  12.24, -13.38,
23514             0.04,   0.00,  -0.30,  -0.27,  -0.01,  10.07, -13.81,   0.04,
23515             0.00,  -0.31,  -0.23,  -0.01,  10.46,  13.10,   0.08,  -0.10,
23516             0.29,  -0.23,  -0.01,  16.55,  -1.71,  -0.08,   0.00,   0.00,
23517            -0.37,   9.75, -12.80,   0.00,   0.00,  -0.29,  -0.22,  -0.01,
23518             9.11,  12.80,   0.00,   0.00,   0.29,  -0.20,   0.00,   0.00,
23519            -6.44, -13.80,   0.00,   0.00,  -0.31,   0.14,  -9.19, -12.00,
23520             0.00,   0.00,  -0.27,   0.21, -10.30,  10.90,   0.08,   0.10,
23521 
23522        /* 1236-1363 */
23523             0.24,   0.23,   0.01,  14.92,  -0.80,  -0.04,   0.00,   0.00,
23524            -0.33,  10.02, -10.80,   0.00,   0.00,  -0.24,  -0.22,  -0.01,
23525            -9.75,  10.40,   0.04,   0.00,   0.23,   0.22,   0.01,   9.67,
23526           -10.40,  -0.04,   0.00,  -0.23,  -0.22,  -0.01,  -8.28, -11.20,
23527             0.04,   0.00,  -0.25,   0.19,  13.32,  -1.41,  -0.08,   0.00,
23528             0.00,  -0.30,   8.27,  10.50,   0.04,   0.00,   0.23,  -0.19,
23529             0.00,   0.00,  13.13,   0.00,   0.00,   0.00,   0.00,  -0.29,
23530           -12.93,   0.70,   0.04,   0.00,   0.00,   0.29,   7.91, -10.20,
23531             0.00,   0.00,  -0.23,  -0.18,  -7.84, -10.00,  -0.04,   0.00,
23532            -0.22,   0.18,   7.44,   9.60,   0.00,   0.00,   0.21,  -0.17,
23533            -7.64,   9.40,   0.08,   0.10,   0.21,   0.17,   0.01, -11.38,
23534             0.60,   0.04,   0.00,   0.00,   0.25,  -7.48,   8.30,   0.00,
23535             0.00,   0.19,   0.17, -10.98,  -0.20,   0.00,   0.00,   0.00,
23536             0.25,  10.98,   0.20,   0.00,   0.00,   0.00,  -0.25,   7.40,
23537            -7.90,  -0.04,   0.00,  -0.18,  -0.17,  -6.09,   8.40,  -0.04,
23538             0.00,   0.19,   0.14,  -6.94,  -7.49,   0.00,   0.00,  -0.17,
23539 
23540        /* 1364-1491 */
23541             0.16,   6.92,   7.50,   0.04,   0.00,   0.17,  -0.15,   6.20,
23542             8.09,   0.00,   0.00,   0.18,  -0.14,  -6.12,   7.80,   0.04,
23543             0.00,   0.17,   0.14,   5.85,  -7.50,   0.00,   0.00,  -0.17,
23544            -0.13,  -6.48,   6.90,   0.08,   0.10,   0.15,   0.14,   0.01,
23545             6.32,   6.90,   0.00,   0.00,   0.15,  -0.14,   5.61,  -7.20,
23546             0.00,   0.00,  -0.16,  -0.13,   9.07,   0.00,   0.00,   0.00,
23547             0.00,  -0.20,   5.25,   6.90,   0.00,   0.00,   0.15,  -0.12,
23548            -8.47,  -0.40,   0.00,   0.00,   0.00,   0.19,   6.32,  -5.39,
23549            -1.11,   1.10,  -0.12,  -0.14,   0.02,   0.02,   5.73,  -6.10,
23550            -0.04,   0.00,  -0.14,  -0.13,   4.70,   6.60,  -0.04,   0.00,
23551             0.15,  -0.11,  -4.90,  -6.40,   0.00,   0.00,  -0.14,   0.11,
23552            -5.33,   5.60,   0.04,   0.10,   0.13,   0.12,   0.01,  -4.81,
23553             6.00,   0.04,   0.00,   0.13,   0.11,   5.13,   5.50,   0.04,
23554             0.00,   0.12,  -0.11,   4.50,   5.90,   0.00,   0.00,   0.13,
23555            -0.10,  -4.22,   6.10,   0.00,   0.00,   0.14,  -4.53,   5.70,
23556             0.00,   0.00,   0.13,   0.10,   4.18,   5.70,   0.00,   0.00,
23557 
23558        /* 1492-1619 */
23559             0.13,  -4.75,  -5.19,   0.00,   0.00,  -0.12,   0.11,  -4.06,
23560             5.60,   0.00,   0.00,   0.13,  -3.98,   5.60,  -0.04,   0.00,
23561             0.13,   4.02,  -5.40,   0.00,   0.00,  -0.12,   4.49,  -4.90,
23562            -0.04,   0.00,  -0.11,  -0.10,  -3.62,  -5.40,  -0.16,   0.20,
23563            -0.12,   0.00,   0.01,   4.38,   4.80,   0.00,   0.00,   0.11,
23564            -6.40,  -0.10,   0.00,   0.00,   0.00,   0.14,  -3.98,   5.00,
23565             0.04,   0.00,   0.11,  -3.82,  -5.00,   0.00,   0.00,  -0.11,
23566            -3.71,   5.07,   0.00,   0.00,   0.11,   4.14,   4.40,   0.00,
23567             0.00,   0.10,  -6.01,  -0.50,  -0.04,   0.00,   0.00,   0.13,
23568            -4.04,   4.39,   0.00,   0.00,   0.10,   3.45,  -4.72,   0.00,
23569             0.00,  -0.11,   3.31,   4.71,   0.00,   0.00,   0.11,   3.26,
23570            -4.50,   0.00,   0.00,  -0.10,  -3.26,  -4.50,   0.00,   0.00,
23571            -0.10,  -3.34,  -4.40,   0.00,   0.00,  -0.10,  -3.74,  -4.00,
23572             3.70,   4.00,   3.34,  -4.30,   3.30,  -4.30,  -3.66,   3.90,
23573             0.04,   3.66,   3.90,   0.04,  -3.62,  -3.90,  -3.61,   3.90,
23574            -0.20,   5.30,   0.00,   0.00,   0.12,   3.06,   4.30,   3.30,
23575 
23576        /* 1620-1747 */
23577             4.00,   0.40,   0.20,   3.10,   4.10,  -3.06,   3.90,  -3.30,
23578            -3.60,  -3.30,   3.36,   0.01,   3.14,   3.40,  -4.57,  -0.20,
23579             0.00,   0.00,   0.00,   0.10,  -2.70,  -3.60,   2.94,  -3.20,
23580            -2.90,   3.20,   2.47,  -3.40,   2.55,  -3.30,   2.80,  -3.08,
23581             2.51,   3.30,  -4.10,   0.30,  -0.12,  -0.10,   4.10,   0.20,
23582            -2.74,   3.00,   2.46,   3.23,  -3.66,   1.20,  -0.20,   0.20,
23583             3.74,  -0.40,  -2.51,  -2.80,  -3.74,   2.27,  -2.90,   0.00,
23584             0.00,  -2.50,   2.70,  -2.51,   2.60,  -3.50,   0.20,   3.38,
23585            -2.22,  -2.50,   3.26,  -0.40,   1.95,  -2.60,   3.22,  -0.40,
23586            -0.04,  -1.79,  -2.60,   1.91,   2.50,   0.74,   3.05,  -0.04,
23587             0.08,   2.11,  -2.30,  -2.11,   2.20,  -1.87,  -2.40,   2.03,
23588            -2.20,  -2.03,   2.20,   2.98,   0.00,   0.00,   2.98,  -1.71,
23589             2.40,   2.94,  -0.10,  -0.12,   0.10,   1.67,   2.40,  -1.79,
23590             2.30,  -1.79,   2.20,  -1.67,   2.20,   1.79,  -2.00,   1.87,
23591            -1.90,   1.63,  -2.10,  -1.59,   2.10,   1.55,  -2.10,  -1.55,
23592             2.10,  -2.59,  -0.20,  -1.75,  -1.90,  -1.75,   1.90,  -1.83,
23593 
23594        /* 1748-1875 */
23595            -1.80,   1.51,   2.00,  -1.51,  -2.00,   1.71,   1.80,   1.31,
23596             2.10,  -1.43,   2.00,   1.43,   2.00,  -2.43,  -1.51,   1.90,
23597            -1.47,   1.90,   2.39,   0.20,  -2.39,   1.39,   1.90,   1.39,
23598            -1.80,   1.47,  -1.60,   1.47,  -1.60,   1.43,  -1.50,  -1.31,
23599             1.60,   1.27,  -1.60,  -1.27,   1.60,   1.27,  -1.60,   2.03,
23600             1.35,   1.50,  -1.39,  -1.40,   1.95,  -0.20,  -1.27,   1.49,
23601             1.19,   1.50,   1.27,   1.40,   1.15,   1.50,   1.87,  -0.10,
23602            -1.12,  -1.50,   1.87,  -1.11,  -1.50,  -1.11,  -1.50,   0.00,
23603             0.00,   1.19,   1.40,   1.27,  -1.30,  -1.27,  -1.30,  -1.15,
23604             1.40,  -1.23,   1.30,  -1.23,  -1.30,   1.22,  -1.29,   1.07,
23605            -1.40,   1.75,  -0.20,  -1.03,  -1.40,  -1.07,   1.20,  -1.03,
23606             1.15,   1.07,   1.10,   1.51,  -1.03,   1.10,   1.03,  -1.10,
23607             0.00,   0.00,  -1.03,  -1.10,   0.91,  -1.20,  -0.88,  -1.20,
23608            -0.88,   1.20,  -0.95,   1.10,  -0.95,  -1.10,   1.43,  -1.39,
23609             0.95,  -1.00,  -0.95,   1.00,  -0.80,   1.10,   0.91,  -1.00,
23610            -1.35,   0.88,   1.00,  -0.83,   1.00,  -0.91,   0.90,   0.91,
23611 
23612        /* 1876-2003 */
23613             0.90,   0.88,  -0.90,  -0.76,  -1.00,  -0.76,   1.00,   0.76,
23614             1.00,  -0.72,   1.00,   0.84,  -0.90,   0.84,   0.90,   1.23,
23615             0.00,   0.00,  -0.52,  -1.10,  -0.68,   1.00,   1.19,  -0.20,
23616             1.19,   0.76,   0.90,   1.15,  -0.10,   1.15,  -0.10,   0.72,
23617            -0.90,  -1.15,  -1.15,   0.68,   0.90,  -0.68,   0.90,  -1.11,
23618             0.00,   0.00,   0.20,   0.79,   0.80,  -1.11,  -0.10,   0.00,
23619             0.00,  -0.48,  -1.00,  -0.76,  -0.80,  -0.72,  -0.80,  -1.07,
23620            -0.10,   0.64,   0.80,  -0.64,  -0.80,   0.64,   0.80,   0.40,
23621             0.60,   0.52,  -0.50,  -0.60,  -0.80,  -0.71,   0.70,  -0.99,
23622             0.99,   0.56,   0.80,  -0.56,   0.80,   0.68,  -0.70,   0.68,
23623             0.70,  -0.95,  -0.64,   0.70,   0.64,   0.70,  -0.60,   0.70,
23624            -0.60,  -0.70,  -0.91,  -0.10,  -0.51,   0.76,  -0.91,  -0.56,
23625             0.70,   0.88,   0.88,  -0.63,  -0.60,   0.55,  -0.60,  -0.80,
23626             0.80,  -0.80,  -0.52,   0.60,   0.52,   0.60,   0.52,  -0.60,
23627            -0.48,   0.60,   0.48,   0.60,   0.48,   0.60,  -0.76,   0.44,
23628            -0.60,   0.52,  -0.50,  -0.52,   0.50,   0.40,   0.60,  -0.40,
23629 
23630        /* 2004-2131 */
23631            -0.60,   0.40,  -0.60,   0.72,  -0.72,  -0.51,  -0.50,  -0.48,
23632             0.50,   0.48,  -0.50,  -0.48,   0.50,  -0.48,   0.50,   0.48,
23633            -0.50,  -0.48,  -0.50,  -0.68,  -0.68,   0.44,   0.50,  -0.64,
23634            -0.10,  -0.64,  -0.10,  -0.40,   0.50,   0.40,   0.50,   0.40,
23635             0.50,   0.00,   0.00,  -0.40,  -0.50,  -0.36,  -0.50,   0.36,
23636            -0.50,   0.60,  -0.60,   0.40,  -0.40,   0.40,   0.40,  -0.40,
23637             0.40,  -0.40,   0.40,  -0.56,  -0.56,   0.36,  -0.40,  -0.36,
23638             0.40,   0.36,  -0.40,  -0.36,  -0.40,   0.36,   0.40,   0.36,
23639             0.40,  -0.52,   0.52,   0.52,   0.32,   0.40,  -0.32,   0.40,
23640            -0.32,   0.40,  -0.32,   0.40,   0.32,  -0.40,  -0.32,  -0.40,
23641             0.32,  -0.40,   0.28,  -0.40,  -0.28,   0.40,   0.28,  -0.40,
23642             0.28,   0.40,   0.48,  -0.48,   0.48,   0.36,  -0.30,  -0.36,
23643            -0.30,   0.00,   0.00,   0.20,   0.40,  -0.44,   0.44,  -0.44,
23644            -0.44,  -0.44,  -0.44,   0.32,  -0.30,   0.32,   0.30,   0.24,
23645             0.30,  -0.12,  -0.10,  -0.28,   0.30,   0.28,   0.30,   0.28,
23646             0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,
23647 
23648        /* 2132-2259 */
23649             0.30,  -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.24,
23650            -0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,   0.30,   0.24,
23651            -0.30,  -0.24,   0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,
23652            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,   0.20,
23653            -0.30,   0.20,  -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,
23654            -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,   0.30,  -0.20,
23655            -0.30,   0.20,  -0.30,   0.20,  -0.30,  -0.36,  -0.36,  -0.36,
23656            -0.04,   0.30,   0.12,  -0.10,  -0.32,  -0.24,   0.20,   0.24,
23657             0.20,   0.20,  -0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.20,
23658             0.20,   0.20,  -0.20,   0.20,   0.20,   0.20,   0.20,  -0.20,
23659            -0.20,   0.00,   0.00,  -0.20,  -0.20,  -0.20,   0.20,  -0.20,
23660             0.20,   0.20,  -0.20,  -0.20,  -0.20,   0.20,   0.20,   0.20,
23661             0.20,   0.20,  -0.20,   0.20,  -0.20,   0.28,   0.28,   0.28,
23662             0.28,   0.28,   0.28,  -0.28,   0.28,   0.12,   0.00,   0.24,
23663             0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,
23664            -0.16,   0.20,   0.16,   0.20,  -0.16,   0.20,  -0.16,   0.20,
23665 
23666        /* 2260-2387 */
23667            -0.16,   0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,  -0.20,
23668            -0.16,   0.20,  -0.16,  -0.20,  -0.16,   0.20,   0.16,   0.20,
23669             0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,   0.20,
23670             0.16,   0.20,  -0.16,  -0.20,   0.16,   0.20,  -0.16,   0.20,
23671             0.16,   0.20,  -0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,
23672            -0.16,  -0.20,   0.24,  -0.24,  -0.24,   0.24,   0.24,   0.12,
23673             0.20,   0.12,   0.20,  -0.12,  -0.20,   0.12,  -0.20,   0.12,
23674            -0.20,  -0.12,   0.20,  -0.12,   0.20,  -0.12,  -0.20,   0.12,
23675             0.20,   0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23676            -0.20,  -0.12,   0.20,   0.12,   0.20,   0.00,   0.00,  -0.12,
23677             0.20,  -0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23678             0.20,   0.00,  -0.21,  -0.20,   0.00,   0.00,   0.20,  -0.20,
23679            -0.20,  -0.20,   0.20,  -0.16,  -0.10,   0.00,   0.17,   0.16,
23680             0.16,   0.16,   0.16,  -0.16,   0.16,   0.16,  -0.16,   0.16,
23681            -0.16,   0.16,   0.12,   0.10,   0.12,  -0.10,  -0.12,   0.10,
23682            -0.12,   0.10,   0.12,  -0.10,  -0.12,   0.12,  -0.12,   0.12,
23683 
23684        /* 2388-2515 */
23685            -0.12,   0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,
23686            -0.12,   0.12,   0.12,   0.12,   0.12,  -0.12,  -0.12,   0.12,
23687             0.12,   0.12,  -0.12,   0.12,  -0.12,  -0.12,  -0.12,   0.12,
23688            -0.12,  -0.12,   0.12,   0.00,   0.11,   0.11,-122.67, 164.70,
23689           203.78, 273.50,   3.58,   2.74,   6.18,  -4.56,   0.00,  -0.04,
23690             0.00,  -0.07,  57.44, -77.10,  95.82, 128.60,  -1.77,  -1.28,
23691             2.85,  -2.14,  82.14,  89.50,   0.00,   0.00,   2.00,  -1.84,
23692            -0.04,  47.73, -64.10,  23.79,  31.90,  -1.45,  -1.07,   0.69,
23693            -0.53, -46.38,  50.50,   0.00,   0.00,   1.13,   1.04,   0.02,
23694           -18.38,   0.00,  63.80,   0.00,   0.00,   0.41,   0.00,  -1.43,
23695            59.07,   0.00,   0.00,   0.00,   0.00,  -1.32,  57.28,   0.00,
23696             0.00,   0.00,   0.00,  -1.28, -48.65,   0.00,  -1.15,   0.00,
23697             0.00,   1.09,   0.00,   0.03, -18.30,  24.60, -17.30, -23.20,
23698             0.56,   0.41,  -0.51,   0.39, -16.91,  26.90,   8.43,  13.30,
23699             0.60,   0.38,   0.31,  -0.19,   1.23,  -1.70, -19.13, -25.70,
23700            -0.03,  -0.03,  -0.58,   0.43,  -0.72,   0.90, -17.34, -23.30,
23701 
23702        /* 2516-2643 */
23703             0.03,   0.02,  -0.52,   0.39, -19.49, -21.30,   0.00,   0.00,
23704            -0.48,   0.44,   0.01,  20.57, -20.10,   0.64,   0.70,  -0.45,
23705            -0.46,   0.00,  -0.01,   4.89,   5.90, -16.55,  19.90,   0.14,
23706            -0.11,   0.44,   0.37,  18.22,  19.80,   0.00,   0.00,   0.44,
23707            -0.41,  -0.01,   4.89,  -5.30, -16.51, -18.00,  -0.11,  -0.11,
23708            -0.41,   0.37, -17.86,   0.00,  17.10,   0.00,   0.00,   0.40,
23709             0.00,  -0.38,   0.32,   0.00,  24.42,   0.00,   0.00,  -0.01,
23710             0.00,  -0.55, -23.79,   0.00,   0.00,   0.00,   0.00,   0.53,
23711            14.72, -16.00,  -0.32,   0.00,  -0.36,  -0.33,  -0.01,   0.01,
23712             3.34,  -4.50,  11.86,  15.90,  -0.11,  -0.07,   0.35,  -0.27,
23713            -3.26,   4.40,  11.62,  15.60,   0.09,   0.07,   0.35,  -0.26,
23714           -19.53,   0.00,   5.09,   0.00,   0.00,   0.44,   0.00,  -0.11,
23715           -13.48,  14.70,   0.00,   0.00,   0.33,   0.30,   0.01,  10.86,
23716           -14.60,   3.18,   4.30,  -0.33,  -0.24,   0.09,  -0.07, -11.30,
23717           -15.10,   0.00,   0.00,  -0.34,   0.25,   0.01,   2.03,  -2.70,
23718            10.82,  14.50,  -0.07,  -0.05,   0.32,  -0.24,  17.46,   0.00,
23719 
23720        /* 2644-2771 */
23721             0.00,   0.00,   0.00,  -0.39,  16.43,   0.00,   0.52,   0.00,
23722             0.00,  -0.37,   0.00,  -0.01,   9.35,   0.00,  13.29,   0.00,
23723             0.00,  -0.21,   0.00,  -0.30, -10.42,  11.40,   0.00,   0.00,
23724             0.25,   0.23,   0.01,   0.44,   0.50, -10.38,  11.30,   0.02,
23725            -0.01,   0.25,   0.23, -14.64,   0.00,   0.00,   0.00,   0.00,
23726             0.33,   0.56,   0.80,  -8.67,  11.70,   0.02,  -0.01,   0.26,
23727             0.19,  13.88,   0.00,  -2.47,   0.00,   0.00,  -0.31,   0.00,
23728             0.06,  -1.99,   2.70,   7.72,  10.30,   0.06,   0.04,   0.23,
23729            -0.17,  -0.20,   0.00,  13.05,   0.00,   0.00,   0.00,   0.00,
23730            -0.29,   6.92,  -9.30,   3.34,   4.50,  -0.21,  -0.15,   0.10,
23731            -0.07,  -6.60,   0.00,  10.70,   0.00,   0.00,   0.15,   0.00,
23732            -0.24,  -8.04,  -8.70,   0.00,   0.00,  -0.19,   0.18, -10.58,
23733             0.00,  -3.10,   0.00,   0.00,   0.24,   0.00,   0.07,  -7.32,
23734             8.00,  -0.12,  -0.10,   0.18,   0.16,   1.63,   1.70,   6.96,
23735            -7.60,   0.03,  -0.04,  -0.17,  -0.16,  -3.62,   0.00,   9.86,
23736             0.00,   0.00,   0.08,   0.00,  -0.22,   0.20,  -0.20,  -6.88,
23737 
23738        /* 2772-2899 */
23739            -7.50,   0.00,   0.00,  -0.17,   0.15,  -8.99,   0.00,   4.02,
23740             0.00,   0.00,   0.20,   0.00,  -0.09,  -1.07,   1.40,  -5.69,
23741            -7.70,   0.03,   0.02,  -0.17,   0.13,   6.48,  -7.20,  -0.48,
23742            -0.50,  -0.16,  -0.14,  -0.01,   0.01,   5.57,  -7.50,   1.07,
23743             1.40,  -0.17,  -0.12,   0.03,  -0.02,   8.71,   0.00,   3.54,
23744             0.00,   0.00,  -0.19,   0.00,  -0.08,   0.40,   0.00,   9.27,
23745             0.00,   0.00,  -0.01,   0.00,  -0.21,  -6.13,   6.70,  -1.19,
23746            -1.30,   0.15,   0.14,  -0.03,   0.03,   5.21,  -5.70,  -2.51,
23747            -2.60,  -0.13,  -0.12,  -0.06,   0.06,   5.69,  -6.20,  -0.12,
23748            -0.10,  -0.14,  -0.13,  -0.01,   2.03,  -2.70,   4.53,   6.10,
23749            -0.06,  -0.05,   0.14,  -0.10,   5.01,   5.50,  -2.51,   2.70,
23750             0.12,  -0.11,   0.06,   0.06,  -1.91,   2.60,  -4.38,  -5.90,
23751             0.06,   0.04,  -0.13,   0.10,   4.65,  -6.30,   0.00,   0.00,
23752            -0.14,  -0.10,  -5.29,   5.70,   0.00,   0.00,   0.13,   0.12,
23753            -2.23,  -4.00,  -4.65,   4.20,  -0.09,   0.05,   0.10,   0.10,
23754            -4.53,   6.10,   0.00,   0.00,   0.14,   0.10,   2.47,   2.70,
23755 
23756        /* 2900-3027 */
23757            -4.46,   4.90,   0.06,  -0.06,   0.11,   0.10,  -5.05,   5.50,
23758             0.84,   0.90,   0.12,   0.11,   0.02,  -0.02,   4.97,  -5.40,
23759            -1.71,   0.00,  -0.12,  -0.11,   0.00,   0.04,  -0.99,  -1.30,
23760             4.22,  -5.70,  -0.03,   0.02,  -0.13,  -0.09,   0.99,   1.40,
23761             4.22,  -5.60,   0.03,  -0.02,  -0.13,  -0.09,  -4.69,  -5.20,
23762             0.00,   0.00,  -0.12,   0.10,  -3.42,   0.00,   6.09,   0.00,
23763             0.00,   0.08,   0.00,  -0.14,  -4.65,  -5.10,   0.00,   0.00,
23764            -0.11,   0.10,   0.00,   0.00,  -4.53,  -5.00,   0.00,   0.00,
23765            -0.11,   0.10,  -2.43,  -2.70,  -3.82,   4.20,  -0.06,   0.05,
23766             0.10,   0.09,   0.00,   0.00,  -4.53,   4.90,   0.00,   0.00,
23767             0.11,   0.10,  -4.49,  -4.90,   0.00,   0.00,  -0.11,   0.10,
23768             2.67,  -2.90,  -3.62,  -3.90,  -0.06,  -0.06,  -0.09,   0.08,
23769             3.94,  -5.30,   0.00,   0.00,  -0.12,  -3.38,   3.70,  -2.78,
23770            -3.10,   0.08,   0.08,  -0.07,   0.06,   3.18,  -3.50,  -2.82,
23771            -3.10,  -0.08,  -0.07,  -0.07,   0.06,  -5.77,   0.00,   1.87,
23772             0.00,   0.00,   0.13,   0.00,  -0.04,   3.54,  -4.80,  -0.64,
23773 
23774        /* 3028-3155 */
23775            -0.90,  -0.11,   0.00,  -0.02,  -3.50,  -4.70,   0.68,  -0.90,
23776            -0.11,   0.00,  -0.02,   5.49,   0.00,   0.00,   0.00,   0.00,
23777            -0.12,   1.83,  -2.50,   2.63,   3.50,  -0.06,   0.00,   0.08,
23778             3.02,  -4.10,   0.68,   0.90,  -0.09,   0.00,   0.02,   0.00,
23779             0.00,   5.21,   0.00,   0.00,   0.00,   0.00,  -0.12,  -3.54,
23780             3.80,   2.70,   3.60,  -1.35,   1.80,   0.08,   0.00,   0.04,
23781            -2.90,   3.90,   0.68,   0.90,   0.09,   0.00,   0.02,   0.80,
23782            -1.10,  -2.78,  -3.70,  -0.02,   0.00,  -0.08,   4.10,   0.00,
23783            -2.39,   0.00,   0.00,  -0.09,   0.00,   0.05,  -1.59,   2.10,
23784             2.27,   3.00,   0.05,   0.00,   0.07,  -2.63,   3.50,  -0.48,
23785            -0.60,  -2.94,  -3.20,  -2.94,   3.20,   2.27,  -3.00,  -1.11,
23786            -1.50,  -0.07,   0.00,  -0.03,  -0.56,  -0.80,  -2.35,   3.10,
23787             0.00,  -0.60,  -3.42,   1.90,  -0.12,  -0.10,   2.63,  -2.90,
23788             2.51,   2.80,  -0.64,   0.70,  -0.48,  -0.60,   2.19,  -2.90,
23789             0.24,  -0.30,   2.15,   2.90,   2.15,  -2.90,   0.52,   0.70,
23790             2.07,  -2.80,  -3.10,   0.00,   1.79,   0.00,   0.00,   0.07,
23791 
23792        /* 3156-3283 */
23793             0.00,  -0.04,   0.88,   0.00,  -3.46,   2.11,   2.80,  -0.36,
23794             0.50,   3.54,  -0.20,  -3.50,  -1.39,   1.50,  -1.91,  -2.10,
23795            -1.47,   2.00,   1.39,   1.90,   2.07,  -2.30,   0.91,   1.00,
23796             1.99,  -2.70,   3.30,   0.00,   0.60,  -0.44,  -0.70,  -1.95,
23797             2.60,   2.15,  -2.40,  -0.60,  -0.70,   3.30,   0.84,   0.00,
23798            -3.10,  -3.10,   0.00,  -0.72,  -0.32,   0.40,  -1.87,  -2.50,
23799             1.87,  -2.50,   0.32,   0.40,  -0.24,   0.30,  -1.87,  -2.50,
23800            -0.24,  -0.30,   1.87,  -2.50,  -2.70,   0.00,   1.55,   2.03,
23801             2.20,  -2.98,  -1.99,  -2.20,   0.12,  -0.10,  -0.40,   0.50,
23802             1.59,   2.10,   0.00,   0.00,  -1.79,   2.00,  -1.03,   1.40,
23803            -1.15,  -1.60,   0.32,   0.50,   1.39,  -1.90,   2.35,  -1.27,
23804             1.70,   0.60,   0.80,  -0.32,  -0.40,   1.35,  -1.80,   0.44,
23805             0.00,   2.23,  -0.84,   0.90,  -1.27,  -1.40,  -1.47,   1.60,
23806            -0.28,  -0.30,  -0.28,   0.40,  -1.27,  -1.70,   0.28,  -0.40,
23807            -1.43,  -1.50,   0.00,   0.00,  -1.27,  -1.70,   2.11,  -0.32,
23808            -0.40,  -1.23,   1.60,   1.19,  -1.30,  -0.72,  -0.80,   0.72,
23809 
23810        /* 3284-3411 */
23811            -0.80,  -1.15,  -1.30,  -1.35,  -1.50,  -1.19,  -1.60,  -0.12,
23812             0.20,   1.79,   0.00,  -0.88,  -0.28,   0.40,   1.11,   1.50,
23813            -1.83,   0.00,   0.56,  -0.12,   0.10,  -1.27,  -1.40,   0.00,
23814             0.00,   1.15,   1.50,  -0.12,   0.20,   1.11,   1.50,   0.36,
23815            -0.50,  -1.07,  -1.40,  -1.11,   1.50,   1.67,   0.00,   0.80,
23816            -1.11,   0.00,   1.43,   1.23,  -1.30,  -0.24,  -1.19,  -1.30,
23817            -0.24,   0.20,  -0.44,  -0.90,  -0.95,   1.10,   1.07,  -1.40,
23818             1.15,  -1.30,   1.03,  -1.10,  -0.56,  -0.60,  -0.68,   0.90,
23819            -0.76,  -1.00,  -0.24,  -0.30,   0.95,  -1.30,   0.56,   0.70,
23820             0.84,  -1.10,  -0.56,   0.00,  -1.55,   0.91,  -1.30,   0.28,
23821             0.30,   0.16,  -0.20,   0.95,   1.30,   0.40,  -0.50,  -0.88,
23822            -1.20,   0.95,  -1.10,  -0.48,  -0.50,   0.00,   0.00,  -1.07,
23823             1.20,   0.44,  -0.50,   0.95,   1.10,   0.00,   0.00,   0.92,
23824            -1.30,   0.95,   1.00,  -0.52,   0.60,   1.59,   0.24,  -0.40,
23825             0.91,   1.20,   0.84,  -1.10,  -0.44,  -0.60,   0.84,   1.10,
23826            -0.44,   0.60,  -0.44,   0.60,  -0.84,  -1.10,  -0.80,   0.00,
23827 
23828        /* 3412-3539 */
23829             1.35,   0.76,   0.20,  -0.91,  -1.00,   0.20,  -0.30,  -0.91,
23830            -1.20,  -0.95,   1.00,  -0.48,  -0.50,   0.88,   1.00,   0.48,
23831            -0.50,  -0.95,  -1.10,   0.20,  -0.20,  -0.99,   1.10,  -0.84,
23832             1.10,  -0.24,  -0.30,   0.20,  -0.30,   0.84,   1.10,  -1.39,
23833             0.00,  -0.28,  -0.16,   0.20,   0.84,   1.10,   0.00,   0.00,
23834             1.39,   0.00,   0.00,  -0.95,   1.00,   1.35,  -0.99,   0.00,
23835             0.88,  -0.52,   0.00,  -1.19,   0.20,   0.20,   0.76,  -1.00,
23836             0.00,   0.00,   0.76,   1.00,   0.00,   0.00,   0.76,   1.00,
23837            -0.76,   1.00,   0.00,   0.00,   1.23,   0.76,   0.80,  -0.32,
23838             0.40,  -0.72,   0.80,  -0.40,  -0.40,   0.00,   0.00,  -0.80,
23839            -0.90,  -0.68,   0.90,  -0.16,  -0.20,  -0.16,  -0.20,   0.68,
23840            -0.90,  -0.36,   0.50,  -0.56,  -0.80,   0.72,  -0.90,   0.44,
23841            -0.60,  -0.48,  -0.70,  -0.16,   0.00,  -1.11,   0.32,   0.00,
23842            -1.07,   0.60,  -0.80,  -0.28,  -0.40,  -0.64,   0.00,   0.91,
23843             1.11,   0.64,  -0.90,   0.76,  -0.80,   0.00,   0.00,  -0.76,
23844            -0.80,   1.03,   0.00,  -0.36,  -0.64,  -0.70,   0.36,  -0.40,
23845 
23846        /* 3540-3667 */
23847             1.07,   0.36,  -0.50,  -0.52,  -0.70,   0.60,   0.00,   0.88,
23848             0.95,   0.00,   0.48,   0.16,  -0.20,   0.60,   0.80,   0.16,
23849            -0.20,  -0.60,  -0.80,   0.00,  -1.00,   0.12,   0.20,   0.16,
23850            -0.20,   0.68,   0.70,   0.59,  -0.80,  -0.99,  -0.56,  -0.60,
23851             0.36,  -0.40,  -0.68,  -0.70,  -0.68,  -0.70,  -0.36,  -0.50,
23852            -0.44,   0.60,   0.64,   0.70,  -0.12,   0.10,  -0.52,   0.60,
23853             0.36,   0.40,   0.00,   0.00,   0.95,  -0.84,   0.00,   0.44,
23854             0.56,   0.60,   0.32,  -0.30,   0.00,   0.00,   0.60,   0.70,
23855             0.00,   0.00,   0.60,   0.70,  -0.12,  -0.20,   0.52,  -0.70,
23856             0.00,   0.00,   0.56,   0.70,  -0.12,   0.10,  -0.52,  -0.70,
23857             0.00,   0.00,   0.88,  -0.76,   0.00,  -0.44,   0.00,   0.00,
23858            -0.52,  -0.70,   0.52,  -0.70,   0.36,  -0.40,  -0.44,  -0.50,
23859             0.00,   0.00,   0.60,   0.60,   0.84,   0.00,   0.12,  -0.24,
23860             0.00,   0.80,  -0.56,   0.60,  -0.32,  -0.30,   0.48,  -0.50,
23861             0.28,  -0.30,  -0.48,  -0.50,   0.12,   0.20,   0.48,  -0.60,
23862             0.48,   0.60,  -0.12,   0.20,   0.24,   0.00,   0.76,  -0.52,
23863 
23864        /* 3668-3795 */
23865            -0.60,  -0.52,   0.60,   0.48,  -0.50,  -0.24,  -0.30,   0.12,
23866            -0.10,   0.48,   0.60,   0.52,  -0.20,   0.36,   0.40,  -0.44,
23867             0.50,  -0.24,  -0.30,  -0.48,  -0.60,  -0.44,  -0.60,  -0.12,
23868             0.10,   0.76,   0.76,   0.20,  -0.20,   0.48,   0.50,   0.40,
23869            -0.50,  -0.24,  -0.30,   0.44,  -0.60,   0.44,  -0.60,   0.36,
23870             0.00,  -0.64,   0.72,   0.00,  -0.12,   0.00,  -0.10,  -0.40,
23871            -0.60,  -0.20,  -0.20,  -0.44,   0.50,  -0.44,   0.50,   0.20,
23872             0.20,  -0.44,  -0.50,   0.20,  -0.20,  -0.20,   0.20,  -0.44,
23873            -0.50,   0.64,   0.00,   0.32,  -0.36,   0.50,  -0.20,  -0.30,
23874             0.12,  -0.10,   0.48,   0.50,  -0.12,   0.30,  -0.36,  -0.50,
23875             0.00,   0.00,   0.48,   0.50,  -0.48,   0.50,   0.68,   0.00,
23876            -0.12,   0.56,  -0.40,   0.44,  -0.50,  -0.12,  -0.10,   0.24,
23877             0.30,  -0.40,   0.40,   0.64,   0.00,  -0.24,   0.64,   0.00,
23878            -0.20,   0.00,   0.00,   0.44,  -0.50,   0.44,   0.50,  -0.12,
23879             0.20,  -0.36,  -0.50,   0.12,   0.00,   0.64,  -0.40,   0.50,
23880             0.00,   0.10,   0.00,   0.00,  -0.40,   0.50,   0.00,   0.00,
23881 
23882        /* 3796-3923 */
23883            -0.40,  -0.50,   0.56,   0.00,   0.28,   0.00,   0.10,   0.36,
23884             0.50,   0.00,  -0.10,   0.36,  -0.50,   0.36,   0.50,   0.00,
23885            -0.10,   0.24,  -0.20,  -0.36,  -0.40,   0.16,   0.20,   0.40,
23886            -0.40,   0.00,   0.00,  -0.36,  -0.50,  -0.36,  -0.50,  -0.32,
23887            -0.50,  -0.12,   0.10,   0.20,   0.20,  -0.36,   0.40,  -0.60,
23888             0.60,   0.28,   0.00,   0.52,   0.12,  -0.10,   0.40,   0.40,
23889             0.00,  -0.50,   0.20,  -0.20,  -0.32,   0.40,   0.16,   0.20,
23890            -0.16,   0.20,   0.32,   0.40,   0.56,   0.00,  -0.12,   0.32,
23891            -0.40,  -0.16,  -0.20,   0.00,   0.00,   0.40,   0.40,  -0.40,
23892            -0.40,  -0.40,   0.40,  -0.36,   0.40,   0.12,   0.10,   0.00,
23893             0.10,   0.36,   0.40,   0.00,  -0.10,   0.36,   0.40,  -0.36,
23894             0.40,   0.00,   0.10,   0.32,   0.00,   0.44,   0.12,   0.20,
23895             0.28,  -0.40,   0.00,   0.00,   0.36,   0.40,   0.32,  -0.40,
23896            -0.16,   0.12,   0.10,   0.32,  -0.40,   0.20,   0.30,  -0.24,
23897             0.30,   0.00,   0.10,   0.32,   0.40,   0.00,  -0.10,  -0.32,
23898            -0.40,  -0.32,   0.40,   0.00,   0.10,  -0.52,  -0.52,   0.52,
23899 
23900        /* 3924-4051 */
23901             0.32,  -0.40,   0.00,   0.00,   0.32,   0.40,   0.32,  -0.40,
23902             0.00,   0.00,  -0.32,  -0.40,  -0.32,   0.40,   0.32,   0.40,
23903             0.00,   0.00,   0.32,   0.40,   0.00,   0.00,  -0.32,  -0.40,
23904             0.00,   0.00,   0.32,   0.40,   0.16,   0.20,   0.32,  -0.30,
23905            -0.16,   0.00,  -0.48,  -0.20,   0.20,  -0.28,  -0.30,   0.28,
23906            -0.40,   0.00,   0.00,   0.28,  -0.40,   0.00,   0.00,   0.28,
23907            -0.40,   0.00,   0.00,  -0.28,  -0.40,   0.28,   0.40,  -0.28,
23908            -0.40,  -0.48,  -0.20,   0.20,   0.24,   0.30,   0.44,   0.00,
23909             0.16,   0.24,   0.30,   0.16,  -0.20,   0.24,   0.30,  -0.12,
23910             0.20,   0.20,   0.30,  -0.16,   0.20,   0.00,   0.00,   0.44,
23911            -0.32,   0.30,   0.24,   0.00,  -0.36,   0.36,   0.00,   0.24,
23912             0.12,  -0.20,   0.20,   0.30,  -0.12,   0.00,  -0.28,   0.30,
23913            -0.24,   0.30,   0.12,   0.10,  -0.28,  -0.30,  -0.28,   0.30,
23914             0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,  -0.28,  -0.30,
23915             0.00,   0.00,   0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,
23916            -0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,
23917 
23918        /* 4052-4179 */
23919             0.28,   0.30,   0.00,   0.00,  -0.28,   0.30,   0.28,  -0.30,
23920            -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.00,  -0.10,
23921             0.16,   0.00,   0.36,  -0.20,   0.30,  -0.12,  -0.10,  -0.24,
23922            -0.30,   0.00,   0.00,  -0.24,   0.30,  -0.24,   0.30,   0.00,
23923             0.00,  -0.24,   0.30,  -0.24,   0.30,   0.24,  -0.30,   0.00,
23924             0.00,   0.24,  -0.30,   0.00,   0.00,   0.24,   0.30,   0.24,
23925            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,  -0.20,
23926             0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.32,   0.20,   0.00,
23927             0.10,   0.20,  -0.30,   0.20,  -0.20,   0.12,   0.20,  -0.16,
23928             0.20,   0.16,   0.20,   0.20,   0.30,   0.20,   0.30,   0.00,
23929             0.00,  -0.20,   0.30,   0.00,   0.00,   0.20,   0.30,  -0.20,
23930            -0.30,  -0.20,  -0.30,   0.20,  -0.30,   0.00,   0.00,   0.20,
23931             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
23932             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
23933            -0.30,   0.00,   0.00,  -0.20,  -0.30,   0.00,   0.00,  -0.20,
23934             0.30,   0.00,   0.00,  -0.20,   0.30,   0.00,   0.00,   0.36,
23935 
23936        /* 4180-4307 */
23937             0.00,   0.00,   0.36,   0.12,   0.10,  -0.24,   0.20,   0.12,
23938            -0.20,  -0.16,  -0.20,  -0.13,   0.10,   0.22,   0.21,   0.20,
23939             0.00,  -0.28,   0.32,   0.00,  -0.12,  -0.20,  -0.20,   0.12,
23940            -0.10,   0.12,   0.10,  -0.20,   0.20,   0.00,   0.00,  -0.32,
23941             0.32,   0.00,   0.00,   0.32,   0.32,   0.00,   0.00,  -0.24,
23942            -0.20,   0.24,   0.20,   0.20,   0.00,  -0.24,   0.00,   0.00,
23943            -0.24,  -0.20,   0.00,   0.00,   0.24,   0.20,  -0.24,  -0.20,
23944             0.00,   0.00,  -0.24,   0.20,   0.16,  -0.20,   0.12,   0.10,
23945             0.20,   0.20,   0.00,  -0.10,  -0.12,   0.10,  -0.16,  -0.20,
23946            -0.12,  -0.10,  -0.16,   0.20,   0.20,   0.20,   0.00,   0.00,
23947            -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,
23948             0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,  -0.20,   0.20,
23949             0.20,   0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,  -0.20,
23950             0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,   0.20,
23951             0.20,   0.20,   0.20,   0.12,  -0.20,  -0.12,  -0.10,   0.28,
23952            -0.28,   0.16,  -0.20,   0.00,  -0.10,   0.00,   0.10,  -0.16,
23953 
23954        /* 4308-4435 */
23955             0.20,   0.00,  -0.10,  -0.16,  -0.20,   0.00,  -0.10,   0.16,
23956            -0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,   0.20,  -0.16,
23957             0.20,   0.00,   0.00,   0.16,   0.20,   0.16,  -0.20,   0.16,
23958            -0.20,  -0.16,   0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,
23959             0.20,   0.00,   0.00,   0.16,   0.20,   0.00,   0.00,  -0.16,
23960            -0.20,   0.16,  -0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.16,
23961            -0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,   0.00,   0.16,
23962            -0.20,   0.16,   0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,
23963            -0.20,   0.00,   0.00,  -0.16,  -0.20,   0.00,   0.00,   0.16,
23964             0.20,   0.16,   0.20,   0.00,   0.00,   0.16,   0.20,   0.16,
23965            -0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,
23966             0.10,   0.12,  -0.20,   0.12,  -0.20,   0.00,  -0.10,   0.00,
23967            -0.10,   0.12,   0.20,   0.00,  -0.10,  -0.12,   0.20,  -0.15,
23968             0.20,  -0.24,   0.24,   0.00,   0.00,   0.24,   0.24,   0.12,
23969            -0.20,  -0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
23970            -0.20,   0.12,   0.20,   0.12,   0.20,   0.12,   0.20,   0.12,
23971 
23972        /* 4436-4563 */
23973            -0.20,  -0.12,   0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
23974             0.00,  -0.20,   0.00,   0.00,  -0.12,  -0.20,   0.12,  -0.20,
23975             0.00,   0.00,   0.12,   0.20,  -0.12,   0.20,  -0.12,   0.20,
23976             0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.20,   0.00,
23977             0.12,   0.00,   0.00,  -0.12,   0.20,   0.00,   0.00,  -0.12,
23978            -0.20,   0.00,   0.00,  -0.12,  -0.20,  -0.12,  -0.20,   0.00,
23979             0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,   0.20,  -0.12,
23980            -0.20,   0.00,   0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,
23981             0.20,   0.12,   0.00,   0.20,  -0.12,  -0.20,   0.00,   0.00,
23982             0.12,   0.20,  -0.16,   0.00,   0.16,  -0.20,   0.20,   0.00,
23983             0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,   0.00,   0.00,
23984             0.20,   0.20,  -0.20,   0.00,   0.00,  -0.20,   0.12,   0.00,
23985            -0.16,   0.20,   0.00,   0.00,   0.20,   0.12,  -0.10,   0.00,
23986             0.10,   0.16,  -0.16,  -0.16,  -0.16,  -0.16,  -0.16,   0.00,
23987             0.00,  -0.16,   0.00,   0.00,  -0.16,  -0.16,  -0.16,   0.00,
23988             0.00,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,   0.16,
23989 
23990        /* 4564-4691 */
23991             0.00,   0.00,   0.16,   0.16,   0.00,   0.00,  -0.16,   0.00,
23992             0.00,  -0.16,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,
23993            -0.16,  -0.16,   0.00,   0.00,  -0.16,  -0.16,   0.12,   0.10,
23994             0.12,  -0.10,   0.12,   0.10,   0.00,   0.00,   0.12,   0.10,
23995            -0.12,   0.10,   0.00,   0.00,   0.12,   0.10,   0.12,  -0.10,
23996             0.00,   0.00,  -0.12,  -0.10,   0.00,   0.00,   0.12,   0.10,
23997             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,  -0.12,   0.00,
23998             0.00,   0.12,   0.12,   0.12,   0.12,   0.12,   0.00,   0.00,
23999             0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,   0.12,
24000             0.00,   0.00,   0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,
24001            -0.12,   0.00,   0.00,   0.12,  -0.12,   0.12,   0.12,  -0.12,
24002            -0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24003             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,   0.12,   0.00,
24004             0.00,   0.12,  -0.12,   0.00,   0.00,  -0.12,   0.12,  -0.12,
24005            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.12,  -0.12,
24006             0.00,   0.00,  -0.12,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24007 
24008        /* 4692-NA */
24009            -0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,  -0.12,
24010            -0.12,  -0.12,  -0.12,   0.12,   0.00,   0.00,   0.12,  -0.12,
24011             0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,   0.12,  -0.12,
24012            -0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,  -0.12,   0.00,
24013             0.00,  -0.12,   0.00,   0.00,  -0.12,   0.12,   0.00,   0.00,
24014             0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24015            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,
24016             0.12,   0.00,   0.00,   0.12,   0.12,   0.08,   0.00,   0.04
24017        };
24018 
24019     /* Number of amplitude coefficients */
24020         final int NA = a.length;
24021 
24022     /* Amplitude usage: X or Y, sin or cos, power of T. */
24023         final int jaxy[] = {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};
24024         final int jasc[] = {0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0};
24025         final int japt[] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4};
24026 
24027     /* Miscellaneous */
24028        double t, w, pt[] = new double[MAXPT+1], fa[] = new double[14], xypr[] = new double[2], xypl[] = new double[2], xyls[] = new double[2], arg,
24029               sc[] = new double[2];
24030        int jpt, i, j, jxy, ialast, ifreq, m, ia, jsc;
24031 
24032     /*--------------------------------------------------------------------*/
24033 
24034     /* Interval between fundamental date J2000.0 and given date (JC). */
24035        t = ((date1 - DJ00) + date2) / DJC;
24036 
24037     /* Powers of T. */
24038        w = 1.0;
24039        for (jpt = 0; jpt <= MAXPT; jpt++) {
24040           pt[jpt] = w;
24041           w *= t;
24042        }
24043 
24044     /* Initialize totals in X and Y:  polynomial, luni-solar, planetary. */
24045        for (jxy = 0; jxy < 2; jxy++) {
24046           xypr[jxy] = 0.0;
24047           xyls[jxy] = 0.0;
24048           xypl[jxy] = 0.0;
24049        }
24050 
24051     /* --------------------------------- */
24052     /* Fundamental arguments (IERS 2003) */
24053     /* --------------------------------- */
24054 
24055     /* Mean anomaly of the Moon. */
24056        fa[0] = jauFal03(t);
24057 
24058     /* Mean anomaly of the Sun. */
24059        fa[1] = jauFalp03(t);
24060 
24061     /* Mean argument of the latitude of the Moon. */
24062        fa[2] = jauFaf03(t);
24063 
24064     /* Mean elongation of the Moon from the Sun. */
24065        fa[3] = jauFad03(t);
24066 
24067     /* Mean longitude of the ascending node of the Moon. */
24068        fa[4] = jauFaom03(t);
24069 
24070     /* Planetary longitudes, Mercury through Neptune. */
24071        fa[5] = jauFame03(t);
24072        fa[6] = jauFave03(t);
24073        fa[7] = jauFae03(t);
24074        fa[8] = jauFama03(t);
24075        fa[9] = jauFaju03(t);
24076        fa[10] = jauFasa03(t);
24077        fa[11] = jauFaur03(t);
24078        fa[12] = jauFane03(t);
24079 
24080     /* General accumulated precession in longitude. */
24081        fa[13] = jauFapa03(t);
24082 
24083     /* -------------------------------------- */
24084     /* Polynomial part of precession-nutation */
24085     /* -------------------------------------- */
24086 
24087        for (jxy = 0; jxy < 2; jxy++) {
24088           for (j = MAXPT; j >= 0; j--) {
24089              xypr[jxy] += xyp[jxy][j] * pt[j];
24090           }
24091        }
24092 
24093     /* ---------------------------------- */
24094     /* Nutation periodic terms, planetary */
24095     /* ---------------------------------- */
24096 
24097     /* Work backwards through the coefficients per frequency list. */
24098        ialast = NA;
24099        for (ifreq = NFPL-1; ifreq >= 0; ifreq--) {
24100 
24101        /* Obtain the argument functions. */
24102           arg = 0.0;
24103           for (i = 0; i < 14; i++) {
24104              m = mfapl[ifreq][i];
24105              if (m != 0) arg += (double)m * fa[i];
24106           }
24107           sc[0] = sin(arg);
24108           sc[1] = cos(arg);
24109 
24110        /* Work backwards through the amplitudes at this frequency. */
24111           ia = nc[ifreq+NFLS];
24112           for (i = ialast; i >= ia; i--) {
24113 
24114           /* Coefficient number (0 = 1st). */
24115              j = i-ia;
24116 
24117           /* X or Y. */
24118              jxy = jaxy[j];
24119 
24120           /* Sin or cos. */
24121              jsc = jasc[j];
24122 
24123           /* Power of T. */
24124              jpt = japt[j];
24125 
24126           /* Accumulate the component. */
24127              xypl[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24128           }
24129           ialast = ia-1;
24130        }
24131 
24132     /* ----------------------------------- */
24133     /* Nutation periodic terms, luni-solar */
24134     /* ----------------------------------- */
24135 
24136     /* Continue working backwards through the number of coefficients list. */
24137        for (ifreq = NFLS-1; ifreq >= 0; ifreq--) {
24138 
24139        /* Obtain the argument functions. */
24140           arg = 0.0;
24141           for (i = 0; i < 5; i++) {
24142              m = mfals[ifreq][i];
24143              if (m != 0) arg += (double)m * fa[i];
24144           }
24145           sc[0] = sin(arg);
24146           sc[1] = cos(arg);
24147 
24148        /* Work backwards through the amplitudes at this frequency. */
24149           ia = nc[ifreq];
24150           for (i = ialast; i >= ia; i--) {
24151 
24152           /* Coefficient number (0 = 1st). */
24153              j = i-ia;
24154 
24155           /* X or Y. */
24156              jxy = jaxy[j];
24157 
24158           /* Sin or cos. */
24159              jsc = jasc[j];
24160 
24161           /* Power of T. */
24162              jpt = japt[j];
24163 
24164           /* Accumulate the component. */
24165              xyls[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24166           }
24167           ialast = ia-1;
24168        }
24169 
24170     /* ------------------------------------ */
24171     /* Results:  CIP unit vector components */
24172     /* ------------------------------------ */
24173 
24174        double x = DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6);
24175        double y = DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6);
24176 
24177        return new CelestialIntermediatePole(x, y);
24178 
24179         }
24180     
24181 
24182     /**
24183     *  For a given TT date, compute the X,Y coordinates of the Celestial
24184     *  Intermediate Pole and the CIO locator s, using the IAU 2000A
24185     *  precession-nutation model.
24186     *
24187     *<p>This function is derived from the International Astronomical Union's
24188     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24189     *
24190     *<p>Status:  support function.
24191     *
24192     *<!-- Given: -->
24193     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24194     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24195     *
24196     *<!-- Returned: -->
24197     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24198     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24199     *             s double     <u>returned</u> the CIO locator s (Note 2)
24200     *
24201     * <p>Notes:
24202     * <ol>
24203     *
24204     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24205     *     convenient way between the two arguments.  For example,
24206     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24207     *     among others:
24208     *<pre>
24209     *            date1          date2
24210     *
24211     *         2450123.7           0.0       (JD method)
24212     *         2451545.0       -1421.3       (J2000 method)
24213     *         2400000.5       50123.2       (MJD method)
24214     *         2450123.5           0.2       (date &amp; time method)
24215     *</pre>
24216     *     The JD method is the most natural and convenient to use in
24217     *     cases where the loss of several decimal digits of resolution
24218     *     is acceptable.  The J2000 method is best matched to the way
24219     *     the argument is handled internally and will deliver the
24220     *     optimum resolution.  The MJD method and the date &amp; time methods
24221     *     are both good compromises between resolution and convenience.
24222     *
24223     * <li> The Celestial Intermediate Pole coordinates are the x,y
24224     *     components of the unit vector in the Geocentric Celestial
24225     *     Reference System.
24226     *
24227     * <li> The CIO locator s (in radians) positions the Celestial
24228     *     Intermediate Origin on the equator of the CIP.
24229     *
24230     * <li> A faster, but slightly less accurate result (about 1 mas for
24231     *     X,Y), can be obtained by using instead the jauXys00b function.
24232     *</ol>
24233     *<p>Called:<ul>
24234     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
24235     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24236     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24237     * </ul>
24238     *<p>Reference:
24239     *
24240     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24241     *     IERS Technical Note No. 32, BKG (2004)
24242     *
24243     *@version 2008 May 12
24244     *
24245     *  @since Release 20101201
24246     *
24247     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24248     */
24249     public static ICRFrame jauXys00a(double date1, double date2)
24250     {
24251 
24252     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24253        double rbpn[][] = jauPnm00a(date1, date2);
24254 
24255     /* Extract X,Y. */
24256        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24257 
24258     /* Obtain s. */
24259        double s = jauS00(date1, date2, cip.x, cip.y);
24260 
24261        return new ICRFrame(cip, s);
24262 
24263         }
24264     
24265 
24266     /**
24267      *    The Celestial Intermediate Pole coordinates are the x,y
24268     *     components of the unit vector in the Geocentric Celestial
24269     *     Reference System.
24270     *
24271     *  The CIO locator s (in radians) positions the Celestial
24272     *     Intermediate Origin on the equator of the CIP.
24273  
24274      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
24275      * 
24276      * @since AIDA Stage 1
24277      */
24278     public static class ICRFrame {
24279         public CelestialIntermediatePole cip;
24280         public double s;
24281         public ICRFrame(CelestialIntermediatePole cip, double s) {
24282             this.cip = cip;
24283             this.s = s;
24284         }
24285     }
24286     /**
24287     *  For a given TT date, compute the X,Y coordinates of the Celestial
24288     *  Intermediate Pole and the CIO locator s, using the IAU 2000B
24289     *  precession-nutation model.
24290     *
24291     *<p>This function is derived from the International Astronomical Union's
24292     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24293     *
24294     *<p>Status:  support function.
24295     *
24296     *<!-- Given: -->
24297     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24298     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24299     *
24300     *<!-- Returned: -->
24301     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24302     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24303     *             s             double     <u>returned</u> the CIO locator s (Note 2)
24304     *
24305     * <p>Notes:
24306     * <ol>
24307     *
24308     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24309     *     convenient way between the two arguments.  For example,
24310     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24311     *     among others:
24312     *<pre>
24313     *            date1          date2
24314     *
24315     *         2450123.7           0.0       (JD method)
24316     *         2451545.0       -1421.3       (J2000 method)
24317     *         2400000.5       50123.2       (MJD method)
24318     *         2450123.5           0.2       (date &amp; time method)
24319     *</pre>
24320     *     The JD method is the most natural and convenient to use in
24321     *     cases where the loss of several decimal digits of resolution
24322     *     is acceptable.  The J2000 method is best matched to the way
24323     *     the argument is handled internally and will deliver the
24324     *     optimum resolution.  The MJD method and the date &amp; time methods
24325     *     are both good compromises between resolution and convenience.
24326     *
24327     * <li> The Celestial Intermediate Pole coordinates are the x,y
24328     *     components of the unit vector in the Geocentric Celestial
24329     *     Reference System.
24330     *
24331     * <li> The CIO locator s (in radians) positions the Celestial
24332     *     Intermediate Origin on the equator of the CIP.
24333     *
24334     * <li> The present function is faster, but slightly less accurate (about
24335     *     1 mas in X,Y), than the jauXys00a function.
24336     *</ol>
24337     *<p>Called:<ul>
24338     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
24339     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24340     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24341     * </ul>
24342     *<p>Reference:
24343     *
24344     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24345     *     IERS Technical Note No. 32, BKG (2004)
24346     *
24347     *@version 2008 May 12
24348     *
24349     *  @since Release 20101201
24350     *
24351     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24352     */
24353     public static ICRFrame jauXys00b(double date1, double date2)
24354     {
24355        double rbpn[][] = new double[3][3];
24356 
24357 
24358     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24359        rbpn = jauPnm00b(date1, date2);
24360 
24361     /* Extract X,Y. */
24362        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24363 
24364     /* Obtain s. */
24365        double s = jauS00(date1, date2, cip.x, cip.y);
24366 
24367        return new ICRFrame(cip, s);
24368 
24369         }
24370     
24371 
24372     /**
24373     *  For a given TT date, compute the X,Y coordinates of the Celestial
24374     *  Intermediate Pole and the CIO locator s, using the IAU 2006
24375     *  precession and IAU 2000A nutation models.
24376     *
24377     *<p>This function is derived from the International Astronomical Union's
24378     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24379     *
24380     *<p>Status:  support function.
24381     *
24382     *<!-- Given: -->
24383     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24384     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24385     *
24386     *<!-- Returned: -->
24387     *     @return x double    <u>returned</u> Celestial Intermediate Pole (Note 2)
24388     *             y double    <u>returned</u> Celestial Intermediate Pole (Note 2) 
24389     *             s             double    <u>returned</u> the CIO locator s (Note 2)
24390     *
24391     * <p>Notes:
24392     * <ol>
24393     *
24394     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24395     *     convenient way between the two arguments.  For example,
24396     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24397     *     among others:
24398     *<pre>
24399     *            date1          date2
24400     *
24401     *         2450123.7           0.0       (JD method)
24402     *         2451545.0       -1421.3       (J2000 method)
24403     *         2400000.5       50123.2       (MJD method)
24404     *         2450123.5           0.2       (date &amp; time method)
24405     *</pre>
24406     *     The JD method is the most natural and convenient to use in
24407     *     cases where the loss of several decimal digits of resolution
24408     *     is acceptable.  The J2000 method is best matched to the way
24409     *     the argument is handled internally and will deliver the
24410     *     optimum resolution.  The MJD method and the date &amp; time methods
24411     *     are both good compromises between resolution and convenience.
24412     *
24413     * <li> The Celestial Intermediate Pole coordinates are the x,y components
24414     *     of the unit vector in the Geocentric Celestial Reference System.
24415     *
24416     * <li> The CIO locator s (in radians) positions the Celestial
24417     *     Intermediate Origin on the equator of the CIP.
24418     *
24419     * <li> Series-based solutions for generating X and Y are also available:
24420     *     see Capitaine &amp; Wallace (2006) and jauXy06.
24421     *</ol>
24422     *<p>Called:<ul>
24423     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
24424     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24425     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
24426     * </ul>
24427     *<p>References:
24428     *
24429     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
24430     *
24431     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
24432     *
24433     *@version 2008 May 11
24434     *
24435     *  @since Release 20101201
24436     *
24437     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24438     */
24439     public static ICRFrame jauXys06a(double date1, double date2)
24440     {
24441        double rbpn[][] = new double[3][3];
24442 
24443 
24444     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24445        rbpn = jauPnm06a(date1, date2);
24446 
24447     /* Extract X,Y. */
24448        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24449 
24450     /* Obtain s. */
24451        double s = jauS06(date1, date2, cip.x, cip.y);
24452 
24453        return new ICRFrame(cip, s);
24454 
24455         }
24456     
24457 
24458     /**
24459     *  Zero a p-vector.
24460     *
24461     *<p>This function is derived from the International Astronomical Union's
24462     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24463     *
24464     *<p>Status:  vector/matrix support function.
24465     *
24466     *<!-- Returned: -->
24467     *     @param p         double[3]        <u>returned</u> p-vector
24468     *
24469     *@version 2008 May 11
24470     *
24471     *  @since Release 20101201
24472     *
24473     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24474     */
24475     public static void jauZp(double p[] )
24476     {
24477        p[0] = 0.0;
24478        p[1] = 0.0;
24479        p[2] = 0.0;
24480 
24481        return;
24482 
24483         }
24484     
24485 
24486     /**
24487     *  Zero a pv-vector.
24488     *
24489     *<p>This function is derived from the International Astronomical Union's
24490     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24491     *
24492     *<p>Status:  vector/matrix support function.
24493     *
24494     *<!-- Returned: -->
24495     *     @param pv        double[2][3]        <u>returned</u> pv-vector
24496     *
24497     *<p>Called:<ul>
24498     *     <li>{@link #jauZp} zero p-vector
24499     * </ul>
24500     *@version 2008 May 11
24501     *
24502     *  @since Release 20101201
24503     *
24504     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24505     */
24506     public static void jauZpv(double pv[][])
24507     {
24508        jauZp(pv[0]);
24509        jauZp(pv[1]);
24510 
24511        return;
24512 
24513         }
24514     
24515 
24516     /**
24517     *  Initialize an r-matrix to the null matrix.
24518     *
24519     *<p>This function is derived from the International Astronomical Union's
24520     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24521     *
24522     *<p>Status:  vector/matrix support function.
24523     *
24524     *<!-- Returned: -->
24525     *     @param r         double[3][3]      <u>returned</u> r-matrix
24526     *
24527     *@version 2008 May 11
24528     *
24529     *  @since Release 20101201 
24530     *
24531     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24532     */
24533     public static void jauZr(double r[][])
24534     {
24535        int i, j;
24536 
24537 
24538        for (i = 0; i < 3; i++) {
24539           for (j = 0; j < 3; j++) {
24540              r[i][j] = 0.0;
24541           }
24542        }
24543 
24544        return;
24545 
24546         }
24547     
24548 
24549     /**
24550      * returns the first argument modulo the second.
24551      * Utility function to retain C use of fmod.
24552      * @param d
24553      * @param d2
24554      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 27 Jan 2010
24555      * @return
24556      */
24557     private static double fmod(double d, double d2) {
24558         return d % d2;
24559     }
24560  //IMPL new 20131202 routines after here
24561 
24562     /**
24563      *  Star-independent astrometry parameters.
24564      * 
24565      *  (Vectors eb, eh, em and v are all with respect to BCRS axes.)
24566      *  
24567      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24568      *  @since 20131202
24569      */
24570     public static class  Astrom {
24571         
24572 /** PM time interval (SSB, Julian years) */
24573        public double pmt;       
24574 /** SSB to observer (vector, au) [3]*/
24575        public double eb[] = new double[3];      
24576 /** Sun to observer (unit vector)[3] */
24577        public double eh[] = new double[3];      
24578 /** distance from Sun to observer (au) */
24579        public double em;         
24580 /** barycentric observer velocity (vector, c)[3] */
24581        public double v[] = new double[3];       
24582 /** sqrt(1-|v|^2): reciprocal of Lorenz factor */
24583        public double bm1;        
24584 /** bias-precession-nutation matrix [3][3] */
24585        public double bpn[][] = new double[3][3];  
24586 /** longitude + s' + dERA(DUT) (radians) */
24587        public double along;      
24588 /** geodetic latitude (radians) */
24589        public double phi;        
24590 /** polar motion xp wrt local meridian (radians) */
24591        public double xpl;        
24592 /** polar motion yp wrt local meridian (radians) */
24593        public double ypl;        
24594 /** sine of geodetic latitude */
24595        public double sphi;       
24596 /** cosine of geodetic latitude */
24597        public double cphi;       
24598 /** magnitude of diurnal aberration vector */
24599        public double diurab;     
24600 /** "local" Earth rotation angle (radians) */
24601        public double eral;       
24602 /** refraction constant A (radians) */
24603        public double refa;       
24604 /** refraction constant B (radians) */
24605        public double refb;       
24606        
24607        /**
24608         * 
24609         */
24610        public Astrom(){}
24611     } ;
24612 
24613     /**
24614      *  Body parameters for light deflection.
24615      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24616      *  @since 20131202
24617      */
24618     public static class Ldbody {
24619         /** mass of the body (solar masses) */
24620        public double bm;
24621        /** deflection limiter (radians^2/2) */
24622        public double dl; 
24623        /** barycentric PV of the body (au, au/day)[2][3] */
24624        public double pv[][] = new double [2][3];   
24625     } ;
24626 
24627 
24628     /**
24629      *  Apply aberration to transform natural direction into proper
24630      *  direction.
24631      *
24632      *<p>This function is derived from the International Astronomical Union's
24633      *  SOFA (Standards of Fundamental Astronomy) software collection.
24634      *
24635      *<p>Status:  support function.
24636      *
24637      *<!-- Given: -->
24638      *    @param pnat     double[3]    natural direction to the source (unit vector)
24639      *    @param v        double[3]    observer barycentric velocity in units of c
24640      *    @param s        double       distance between the Sun and the observer (au)
24641      *    @param bm1      double       sqrt(1-|v|^2): reciprocal of Lorenz factor
24642      *
24643      *<!-- Returned:-->
24644      *    @return ppr      double[3]     <b>Returned</b> proper direction to source (unit vector)
24645      *
24646      *<p>Notes:
24647      * <ol>
24648      *
24649      *  <li> The algorithm is based on Expr. (7.40) in the Explanatory
24650      *     Supplement (Urban &amp; Seidelmann 2013), but with the following
24651      *     changes:
24652      *
24653      *     <p>o  Rigorous rather than approximate normalization is applied.
24654      *
24655      *     <p>o  The gravitational potential term from Expr. (7) in
24656      *        Klioner (2003) is added, taking into account only the Sun's
24657      *        contribution.  This has a maximum effect of about
24658      *        0.4 microarcsecond.
24659      *
24660      *  <li> In almost all cases, the maximum accuracy will be limited by the
24661      *     supplied velocity.  For example, if the SOFA iauEpv00 function is
24662      *     used, errors of up to 5 microarcseconds could occur.
24663      *
24664      * </ol>
24665      *<p>References:
24666      * <ul>
24667      *
24668      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
24669      *     the Astronomical Almanac, 3rd ed., University Science Books
24670      *     (2013).
24671      *
24672      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
24673      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
24674      *
24675      * </ul>
24676      *  Called:
24677      * <ul>
24678      *     <li>{@link #jauPdp} scalar product of two p-vectors
24679      *
24680      * </ul>
24681      *@version  2013 October 9
24682      *
24683      *@since JSOFA release 20131202
24684      *
24685      *
24686      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24687      */
24688     public static  double[] jauAb(double pnat[], double v[], double s, double bm1
24689            )
24690     {
24691         int i;
24692         double pdv, w1, w2, r2, w, p[] = new double[3], r;
24693         double ppr[] = new double[3];
24694 
24695         pdv = jauPdp(pnat, v);
24696         w1 = 1.0 + pdv/(1.0 + bm1);
24697         w2 = SRS/s;
24698         r2 = 0.0;
24699         for (i = 0; i < 3; i++) {
24700             w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
24701             p[i] = w;
24702             r2 = r2 + w*w;
24703         }
24704         r = sqrt(r2);
24705         for (i = 0; i < 3; i++) {
24706             ppr[i] = p[i]/r;
24707         }
24708         return ppr;
24709         /* Finished. */
24710 
24711 
24712     }
24713 
24714     /**
24715      *  For a geocentric observer, prepare star-independent astrometry
24716      *  parameters for transformations between ICRS and GCRS coordinates.
24717      *  The Earth ephemeris is supplied by the caller.
24718      *
24719      *  The parameters produced by this function are required in the
24720      *  parallax, light deflection and aberration parts of the astrometric
24721      *  transformation chain.
24722      *
24723      *<p>This function is derived from the International Astronomical Union's
24724      *  SOFA (Standards of Fundamental Astronomy) software collection.
24725      *
24726      *<p>Status:  support function.
24727      *
24728      *<!-- Given: -->
24729      *     @param date1   double        TDB as a 2-part...
24730      *     @param date2   double        ...Julian Date (Note 1)
24731      *     @param ebpv    double[2][3]  Earth barycentric pos/vel (au, au/day)
24732      *     @param ehp     double[3]     Earth heliocentric position (au)
24733      *
24734      *<!-- Returned:-->
24735      *     @param astrom  jauASTROM     <b>Returned</b> star-independent astrometry parameters:
24736      *
24737      *<p>Notes:
24738      * <ol>
24739      *
24740      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24741      *     convenient way between the two arguments.  For example,
24742      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24743      *     others:
24744      *     <pre>
24745      *           date1          date2
24746      *
24747      *         2450123.7           0.0       (JD method)
24748      *         2451545.0       -1421.3       (J2000 method)
24749      *         2400000.5       50123.2       (MJD method)
24750      *         2450123.5           0.2       (date &amp; time method)
24751      *     </pre>
24752      *     <p>The JD method is the most natural and convenient to use in cases
24753      *     where the loss of several decimal digits of resolution is
24754      *     acceptable.  The J2000 method is best matched to the way the
24755      *     argument is handled internally and will deliver the optimum
24756      *     resolution.  The MJD method and the date &amp; time methods are both
24757      *     good compromises between resolution and convenience.  For most
24758      *     applications of this function the choice will not be at all
24759      *     critical.
24760      *
24761      *     <p>TT can be used instead of TDB without any significant impact on
24762      *     accuracy.
24763      *
24764      *  <li> All the vectors are with respect to BCRS axes.
24765      *
24766      *  <li> This is one of several functions that inserts into the astrom
24767      *     structure star-independent parameters needed for the chain of
24768      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
24769      *
24770      *     <p>The various functions support different classes of observer and
24771      *     portions of the transformation chain:
24772      *     <pre>{@code
24773      *          functions         observer        transformation
24774      *
24775      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
24776      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
24777      *       iauApco iauApco13    terrestrial     ICRS <-> observed
24778      *       iauApcs iauApcs13    space           ICRS <-> GCRS
24779      *       iauAper iauAper13    terrestrial     update Earth rotation
24780      *       iauApio iauApio13    terrestrial     CIRS <-> observed
24781      *     }</pre>
24782      *     
24783      *     <p>Those with names ending in "13" use contemporary SOFA models to
24784      *     compute the various ephemerides.  The others accept ephemerides
24785      *     supplied by the caller.
24786      *
24787      *     <p>The transformation from ICRS to GCRS covers space motion,
24788      *     parallax, light deflection, and aberration.  From GCRS to CIRS
24789      *     comprises frame bias and precession-nutation.  From CIRS to
24790      *     observed takes account of Earth rotation, polar motion, diurnal
24791      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
24792      *     transformation), and atmospheric refraction.
24793      *
24794      *  <li> The context structure astrom produced by this function is used by
24795      *     iauAtciq* and iauAticq*.
24796      *
24797      * </ol>
24798      *  Called:
24799      * <ul>
24800      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
24801      *
24802      * </ul>
24803      *@version  2013 October 9
24804      *
24805      *@since JSOFA release 20131202
24806      *
24807      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24808      */
24809     public static void jauApcg(double date1, double date2,
24810             double ebpv[][], double ehp[],
24811             Astrom astrom)
24812     {
24813         /* Geocentric observer */
24814         double pv[][] = { { 0.0, 0.0, 0.0 },
24815             { 0.0, 0.0, 0.0 } };
24816 
24817 
24818             /* Compute the star-independent astrometry parameters. */
24819             jauApcs(date1, date2, pv, ebpv, ehp, astrom);
24820 
24821             /* Finished. */
24822 
24823 
24824     }
24825 
24826     /**
24827      *  For a geocentric observer, prepare star-independent astrometry
24828      *  parameters for transformations between ICRS and GCRS coordinates.
24829      *  The caller supplies the date, and SOFA models are used to predict
24830      *  the Earth ephemeris.
24831      *
24832      *  The parameters produced by this function are required in the
24833      *  parallax, light deflection and aberration parts of the astrometric
24834      *  transformation chain.
24835      *
24836      *<p>This function is derived from the International Astronomical Union's
24837      *  SOFA (Standards of Fundamental Astronomy) software collection.
24838      *
24839      *<p>Status:  support function.
24840      *
24841      *<!-- Given: -->
24842      *     @param date1   double      TDB as a 2-part...
24843      *     @param date2   double      ...Julian Date (Note 1)
24844      *
24845      *<!-- Returned:-->
24846      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
24847      *
24848      *<p>Notes:
24849      * <ol>
24850      *
24851      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24852      *     convenient way between the two arguments.  For example,
24853      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24854      *     others:
24855      *     <pre>
24856      *            date1          date2
24857      *
24858      *         2450123.7           0.0       (JD method)
24859      *         2451545.0       -1421.3       (J2000 method)
24860      *         2400000.5       50123.2       (MJD method)
24861      *         2450123.5           0.2       (date &amp; time method)
24862      *     </pre>
24863      *     <p>The JD method is the most natural and convenient to use in cases
24864      *     where the loss of several decimal digits of resolution is
24865      *     acceptable.  The J2000 method is best matched to the way the
24866      *     argument is handled internally and will deliver the optimum
24867      *     resolution.  The MJD method and the date &amp; time methods are both
24868      *     good compromises between resolution and convenience.  For most
24869      *     applications of this function the choice will not be at all
24870      *     critical.
24871      *
24872      *     <p>TT can be used instead of TDB without any significant impact on
24873      *     accuracy.
24874      *
24875      *  <li> All the vectors are with respect to BCRS axes.
24876      *
24877      *  <li> In cases where the caller wishes to supply his own Earth
24878      *     ephemeris, the function iauApcg can be used instead of the present
24879      *     function.
24880      *
24881      *  <li> This is one of several functions that inserts into the astrom
24882      *     structure star-independent parameters needed for the chain of
24883      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
24884      *
24885      *     <p>The various functions support different classes of observer and
24886      *     portions of the transformation chain:
24887      *     <pre>
24888      *     {@code
24889      *          functions         observer        transformation
24890      *
24891      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
24892      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
24893      *       iauApco iauApco13    terrestrial     ICRS <-> observed
24894      *       iauApcs iauApcs13    space           ICRS <-> GCRS
24895      *       iauAper iauAper13    terrestrial     update Earth rotation
24896      *       iauApio iauApio13    terrestrial     CIRS <-> observed
24897      *     }
24898      *     </pre>
24899      *     <p>Those with names ending in "13" use contemporary SOFA models to
24900      *     compute the various ephemerides.  The others accept ephemerides
24901      *     supplied by the caller.
24902      *
24903      *     <p>The transformation from ICRS to GCRS covers space motion,
24904      *     parallax, light deflection, and aberration.  From GCRS to CIRS
24905      *     comprises frame bias and precession-nutation.  From CIRS to
24906      *     observed takes account of Earth rotation, polar motion, diurnal
24907      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
24908      *     transformation), and atmospheric refraction.
24909      *
24910      *  <li> The context structure astrom produced by this function is used by
24911      *     iauAtciq* and iauAticq*.
24912      *
24913      * </ol>
24914      *  Called:
24915      * <ul>
24916      *     <li>{@link #jauEpv00} Earth position and velocity
24917      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
24918      *
24919      * </ul>
24920      *@version  2013 October 9
24921      *
24922      *@since JSOFA release 20131202
24923      *
24924      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24925      */
24926     public static void jauApcg13(double date1, double date2, Astrom astrom)
24927     {
24928         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
24929 
24930 
24931         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
24932         jauEpv00(date1, date2, ehpv, ebpv);
24933 
24934         /* Compute the star-independent astrometry parameters. */
24935         jauApcg(date1, date2, ebpv, ehpv[0], astrom);
24936 
24937         /* Finished. */
24938 
24939 
24940     }
24941 
24942     /**
24943      *  For a terrestrial observer, prepare star-independent astrometry
24944      *  parameters for transformations between ICRS and geocentric CIRS
24945      *  coordinates.  The Earth ephemeris and CIP/CIO are supplied by the
24946      *  caller.
24947      *
24948      *  The parameters produced by this function are required in the
24949      *  parallax, light deflection, aberration, and bias-precession-nutation
24950      *  parts of the astrometric transformation chain.
24951      *
24952      *<p>This function is derived from the International Astronomical Union's
24953      *  SOFA (Standards of Fundamental Astronomy) software collection.
24954      *
24955      *<p>Status:  support function.
24956      *
24957      *<!-- Given: -->
24958      *     @param date1   double        TDB as a 2-part...
24959      *     @param date2   double        ...Julian Date (Note 1)
24960      *     @param ebpv    double[2][3]  Earth barycentric position/velocity (au, au/day)
24961      *     @param ehp     double[3]     Earth heliocentric position (au)
24962      *     @param x double        CIP X,Y (components of unit vector)
24963      *     @param y double        CIP X,Y (components of unit vector) 
24964      *     @param s       double        the CIO locator s (radians)
24965      *
24966      *<!-- Returned:-->
24967      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
24968      *
24969      *<p>Notes:
24970      * <ol>
24971      *
24972      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24973      *     convenient way between the two arguments.  For example,
24974      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24975      *     others:
24976      *     <pre>
24977      *            date1          date2
24978      *
24979      *         2450123.7           0.0       (JD method)
24980      *         2451545.0       -1421.3       (J2000 method)
24981      *         2400000.5       50123.2       (MJD method)
24982      *         2450123.5           0.2       (date &amp; time method)
24983      *     </pre>
24984      *     <p>The JD method is the most natural and convenient to use in cases
24985      *     where the loss of several decimal digits of resolution is
24986      *     acceptable.  The J2000 method is best matched to the way the
24987      *     argument is handled internally and will deliver the optimum
24988      *     resolution.  The MJD method and the date &amp; time methods are both
24989      *     good compromises between resolution and convenience.  For most
24990      *     applications of this function the choice will not be at all
24991      *     critical.
24992      *
24993      *     <p>TT can be used instead of TDB without any significant impact on
24994      *     accuracy.
24995      *
24996      *  <li> All the vectors are with respect to BCRS axes.
24997      *
24998      *  <li> In cases where the caller does not wish to provide the Earth
24999      *     ephemeris and CIP/CIO, the function iauApci13 can be used instead
25000      *     of the present function.  This computes the required quantities
25001      *     using other SOFA functions.
25002      *
25003      *  <li> This is one of several functions that inserts into the astrom
25004      *     structure star-independent parameters needed for the chain of
25005      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25006      *
25007      *     <p>The various functions support different classes of observer and
25008      *     portions of the transformation chain:
25009      *     <pre>{@code
25010      *          functions         observer        transformation
25011      *
25012      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25013      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25014      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25015      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25016      *       iauAper iauAper13    terrestrial     update Earth rotation
25017      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25018      *     }</pre>
25019      *     <p>Those with names ending in "13" use contemporary SOFA models to
25020      *     compute the various ephemerides.  The others accept ephemerides
25021      *     supplied by the caller.
25022      *
25023      *     <p>The transformation from ICRS to GCRS covers space motion,
25024      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25025      *     comprises frame bias and precession-nutation.  From CIRS to
25026      *     observed takes account of Earth rotation, polar motion, diurnal
25027      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25028      *     transformation), and atmospheric refraction.
25029      *
25030      *  <li> The context structure astrom produced by this function is used by
25031      *     iauAtciq* and iauAticq*.
25032      *
25033      * </ol>
25034      *  Called:
25035      * <ul>
25036      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
25037      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25038      *
25039      * </ul>
25040      *@version  2013 September 25
25041      *
25042      *@since JSOFA release 20131202
25043      *
25044      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25045      */
25046     public static void jauApci(double date1, double date2,
25047             double ebpv[][], double ehp[],
25048             double x, double y, double s,
25049             Astrom astrom)
25050     {
25051 
25052         /* Star-independent astrometry parameters for geocenter. */
25053         jauApcg(date1, date2, ebpv, ehp, astrom);
25054 
25055         /* CIO based BPN matrix. */
25056         astrom.bpn = jauC2ixys(x, y, s);
25057 
25058         /* Finished. */
25059 
25060 
25061     }
25062 
25063     /**
25064      *  For a terrestrial observer, prepare star-independent astrometry
25065      *  parameters for transformations between ICRS and geocentric CIRS
25066      *  coordinates.  The caller supplies the date, and SOFA models are used
25067      *  to predict the Earth ephemeris and CIP/CIO.
25068      *
25069      *  The parameters produced by this function are required in the
25070      *  parallax, light deflection, aberration, and bias-precession-nutation
25071      *  parts of the astrometric transformation chain.
25072      *
25073      *<p>This function is derived from the International Astronomical Union's
25074      *  SOFA (Standards of Fundamental Astronomy) software collection.
25075      *
25076      *<p>Status:  support function.
25077      *
25078      *<!-- Given: -->
25079      *     @param date1   double       TDB as a 2-part...
25080      *     @param date2   double       ...Julian Date (Note 1)
25081      *     
25082      *<!-- Returned:-->
25083      *     @param astrom  jauASTROM    <b>Returned</b> star-independent astrometry parameters:
25084      *                    pmt     double         <b>Returned</b> PM time interval (SSB, Julian years)
25085      *                    eb      double[3]      <b>Returned</b> SSB to observer (vector, au)
25086      *                    eh      double[3]      <b>Returned</b> Sun to observer (unit vector)
25087      *                    em      double         <b>Returned</b> distance from Sun to observer (au)
25088      *                    v       double[3]      <b>Returned</b> barycentric observer velocity (vector, c)
25089      *                    bm1     double         <b>Returned</b> sqrt(1-|v|^2): reciprocal of Lorenz factor
25090      *                    bpn     double[3][3]   <b>Returned</b> bias-precession-nutation matrix
25091      *                    along   double         <b>Returned</b> unchanged
25092      *                    xpl     double         <b>Returned</b> unchanged
25093      *                    ypl     double         <b>Returned</b> unchanged
25094      *                    sphi    double         <b>Returned</b> unchanged
25095      *                    cphi    double         <b>Returned</b> unchanged
25096      *                    diurab  double         <b>Returned</b> unchanged
25097      *                    eral    double         <b>Returned</b> unchanged
25098      *                    refa    double         <b>Returned</b> unchanged
25099      *                    refb    double         <b>Returned</b> unchanged
25100      *     @return       double*       <b>Returned</b> equation of the origins (ERA-GST)
25101      *
25102      *<p>Notes:
25103      * <ol>
25104      *
25105      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25106      *     convenient way between the two arguments.  For example,
25107      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25108      *     others:
25109      *     <pre>
25110      *            date1          date2
25111      *
25112      *         2450123.7           0.0       (JD method)
25113      *         2451545.0       -1421.3       (J2000 method)
25114      *         2400000.5       50123.2       (MJD method)
25115      *         2450123.5           0.2       (date &amp; time method)
25116      *     </pre>
25117      *     <p>The JD method is the most natural and convenient to use in cases
25118      *     where the loss of several decimal digits of resolution is
25119      *     acceptable.  The J2000 method is best matched to the way the
25120      *     argument is handled internally and will deliver the optimum
25121      *     resolution.  The MJD method and the date &amp; time methods are both
25122      *     good compromises between resolution and convenience.  For most
25123      *     applications of this function the choice will not be at all
25124      *     critical.
25125      *
25126      *     <p>TT can be used instead of TDB without any significant impact on
25127      *     accuracy.
25128      *
25129      *  <li> All the vectors are with respect to BCRS axes.
25130      *
25131      *  <li> In cases where the caller wishes to supply his own Earth
25132      *     ephemeris and CIP/CIO, the function iauApci can be used instead
25133      *     of the present function.
25134      *
25135      *  <li> This is one of several functions that inserts into the astrom
25136      *     structure star-independent parameters needed for the chain of
25137      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25138      *
25139      *     <p>The various functions support different classes of observer and
25140      *     portions of the transformation chain:
25141      *     <pre>{@code
25142      *          functions         observer        transformation
25143      *
25144      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25145      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25146      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25147      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25148      *       iauAper iauAper13    terrestrial     update Earth rotation
25149      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25150      *     }</pre>
25151      *     <p>Those with names ending in "13" use contemporary SOFA models to
25152      *     compute the various ephemerides.  The others accept ephemerides
25153      *     supplied by the caller.
25154      *
25155      *     <p>The transformation from ICRS to GCRS covers space motion,
25156      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25157      *     comprises frame bias and precession-nutation.  From CIRS to
25158      *     observed takes account of Earth rotation, polar motion, diurnal
25159      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25160      *     transformation), and atmospheric refraction.
25161      *
25162      *  <li> The context structure astrom produced by this function is used by
25163      *     iauAtciq* and iauAticq*.
25164      *
25165      * </ol>
25166      *  Called:
25167      * <ul>
25168      *     <li>{@link #jauEpv00} Earth position and velocity
25169      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25170      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25171      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25172      *     <li>{@link #jauApci} astrometry parameters, ICRS-CIRS
25173      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25174      *
25175      * </ul>
25176      *@version  2013 October 9
25177      *
25178      *@since JSOFA release 20131202
25179      *
25180      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25181      */
25182     public static double jauApci13(double date1, double date2,
25183             Astrom astrom)
25184     {
25185         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3], r[][], s;
25186 
25187 
25188         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25189         jauEpv00(date1, date2, ehpv, ebpv);
25190 
25191         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25192         r = jauPnm06a(date1, date2);
25193 
25194         /* Extract CIP X,Y. */
25195         CelestialIntermediatePole cip = jauBpn2xy(r);
25196 
25197         /* Obtain CIO locator s. */
25198         s = jauS06(date1, date2, cip.x, cip.y);
25199 
25200         /* Compute the star-independent astrometry parameters. */
25201         jauApci(date1, date2, ebpv, ehpv[0], cip.x, cip.y, s, astrom);
25202 
25203         /* Equation of the origins. */
25204         return jauEors(r, s);
25205 
25206         /* Finished. */
25207 
25208 
25209     }
25210 
25211     /**
25212      *  For a terrestrial observer, prepare star-independent astrometry
25213      *  parameters for transformations between ICRS and observed
25214      *  coordinates.  The caller supplies the Earth ephemeris, the Earth
25215      *  rotation information and the refraction constants as well as the
25216      *  site coordinates.
25217      *
25218      *<p>This function is derived from the International Astronomical Union's
25219      *  SOFA (Standards of Fundamental Astronomy) software collection.
25220      *
25221      *<p>Status:  support function.
25222      *
25223      *<!-- Given: -->
25224      *     @param date1   double        TDB as a 2-part...
25225      *     @param date2   double        ...Julian Date (Note 1)
25226      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day, Note 2)
25227      *     @param ehp     double[3]     Earth heliocentric P (au, Note 2)
25228      *     @param x double        CIP X,Y (components of unit vector)
25229      *     @param y double        CIP X,Y (components of unit vector) 
25230      *     @param s       double        the CIO locator s (radians)
25231      *     @param theta   double        Earth rotation angle (radians)
25232      *     @param elong   double        longitude (radians, east +ve, Note 3)
25233      *     @param phi     double        latitude (geodetic, radians, Note 3)
25234      *     @param hm      double        height above ellipsoid (m, geodetic, Note 3)
25235      *     @param xp double        polar motion coordinates (radians, Note 4)
25236      *     @param yp double        polar motion coordinates (radians, Note 4) 
25237      *     @param sp      double        the TIO locator s' (radians, Note 4)
25238      *     @param refa    double        refraction constant A (radians, Note 5)
25239      *     @param refb    double        refraction constant B (radians, Note 5)
25240      *
25241      *<!-- Returned:-->
25242      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25243      *
25244      *<p>Notes:
25245      * <ol>
25246      *
25247      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25248      *     convenient way between the two arguments.  For example,
25249      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25250      *     others:
25251      *     <pre>
25252      *            date1          date2
25253      *
25254      *         2450123.7           0.0       (JD method)
25255      *         2451545.0       -1421.3       (J2000 method)
25256      *         2400000.5       50123.2       (MJD method)
25257      *         2450123.5           0.2       (date &amp; time method)
25258      *     </pre>
25259      *     <p>The JD method is the most natural and convenient to use in cases
25260      *     where the loss of several decimal digits of resolution is
25261      *     acceptable.  The J2000 method is best matched to the way the
25262      *     argument is handled internally and will deliver the optimum
25263      *     resolution.  The MJD method and the date &amp; time methods are both
25264      *     good compromises between resolution and convenience.  For most
25265      *     applications of this function the choice will not be at all
25266      *     critical.
25267      *
25268      *     <p>TT can be used instead of TDB without any significant impact on
25269      *     accuracy.
25270      *
25271      *  <li> The vectors eb, eh, and all the astrom vectors, are with respect
25272      *     to BCRS axes.
25273      *
25274      *  <li> The geographical coordinates are with respect to the WGS84
25275      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN
25276      *     CONVENTION:  the longitude required by the present function is
25277      *     right-handed, i.e. east-positive, in accordance with geographical
25278      *     convention.
25279      *
25280      *  <li> xp and yp are the coordinates (in radians) of the Celestial
25281      *     Intermediate Pole with respect to the International Terrestrial
25282      *     Reference System (see IERS Conventions), measured along the
25283      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
25284      *     s', in radians, which positions the Terrestrial Intermediate
25285      *     Origin on the equator.  For many applications, xp, yp and
25286      *     (especially) sp can be set to zero.
25287      *
25288      *     <p>Internally, the polar motion is stored in a form rotated onto the
25289      *     local meridian.
25290      *
25291      *  <li> The refraction constants refa and refb are for use in a
25292      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
25293      *     (i.e. refracted) zenith distance and dZ is the amount of
25294      *     refraction.
25295      *
25296      *  <li> It is advisable to take great care with units, as even unlikely
25297      *     values of the input parameters are accepted and processed in
25298      *     accordance with the models used.
25299      *
25300      *  <li> In cases where the caller does not wish to provide the Earth
25301      *     Ephemeris, the Earth rotation information and refraction
25302      *     constants, the function iauApco13 can be used instead of the
25303      *     present function.  This starts from UTC and weather readings etc.
25304      *     and computes suitable values using other SOFA functions.
25305      *
25306      *  <li> This is one of several functions that inserts into the astrom
25307      *     structure star-independent parameters needed for the chain of
25308      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25309      *
25310      *     <p>The various functions support different classes of observer and
25311      *     portions of the transformation chain:
25312      *     <pre>{@code
25313      *          functions         observer        transformation
25314      *
25315      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25316      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25317      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25318      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25319      *       iauAper iauAper13    terrestrial     update Earth rotation
25320      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25321      *     }</pre>
25322      *     <p>Those with names ending in "13" use contemporary SOFA models to
25323      *     compute the various ephemerides.  The others accept ephemerides
25324      *     supplied by the caller.
25325      *
25326      *     <p>The transformation from ICRS to GCRS covers space motion,
25327      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25328      *     comprises frame bias and precession-nutation.  From CIRS to
25329      *     observed takes account of Earth rotation, polar motion, diurnal
25330      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25331      *     transformation), and atmospheric refraction.
25332      *
25333      *  <li> The context structure astrom produced by this function is used by
25334      *     iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25335      *
25336      * </ol>
25337      *  Called:
25338      * <ul>
25339      *     <li>{@link #jauAper} astrometry parameters: update ERA
25340      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25341      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
25342      *     <li>{@link #jauTrxpv} product of transpose of r-matrix and pv-vector
25343      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
25344      *     <li>{@link #jauCr} copy r-matrix
25345      *
25346      * </ul>
25347      *@version  2013 October 9
25348      *
25349      *@since JSOFA release 20131202
25350      *
25351      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25352      * @throws JSOFAInternalError an internal error has occured
25353      * @throws JSOFAIllegalParameter 
25354      */
25355     public static void jauApco(double date1, double date2,
25356             double ebpv[][], double ehp[],
25357             double x, double y, double s, double theta,
25358             double elong, double phi, double hm,
25359             double xp, double yp, double sp,
25360             double refa, double refb,
25361             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
25362     {
25363         double sl, cl, r[][], pvc[][], pv[][];
25364 
25365 
25366         /* Longitude with adjustment for TIO locator s'. */
25367         astrom.along = elong + sp;
25368 
25369         /* Polar motion, rotated onto the local meridian. */
25370         sl = sin(astrom.along);
25371         cl = cos(astrom.along);
25372         astrom.xpl = xp*cl - yp*sl;
25373         astrom.ypl = xp*sl + yp*cl;
25374 
25375         /* Functions of latitude. */
25376         astrom.sphi = sin(phi);
25377         astrom.cphi = cos(phi);
25378 
25379         /* Refraction constants. */
25380         astrom.refa = refa;
25381         astrom.refb = refb;
25382 
25383         /* Local Earth rotation angle. */
25384         jauAper(theta, astrom);
25385 
25386         /* Disable the (redundant) diurnal aberration step. */
25387         astrom.diurab = 0.0;
25388 
25389         /* CIO based BPN matrix. */
25390         r = jauC2ixys(x, y, s);
25391 
25392         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
25393         pvc = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
25394 
25395         /* Rotate into GCRS. */
25396         pv = jauTrxpv(r, pvc);
25397 
25398         /* ICRS <-> GCRS parameters. */
25399         jauApcs(date1, date2, pv, ebpv, ehp, astrom);
25400 
25401         /* Store the CIO based BPN matrix. */
25402         jauCr(r, astrom.bpn );
25403 
25404         /* Finished. */
25405 
25406 
25407     }
25408 
25409     /**
25410      *  For a terrestrial observer, prepare star-independent astrometry
25411      *  parameters for transformations between ICRS and observed
25412      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
25413      *  conditions and observing wavelength, and SOFA models are used to
25414      *  obtain the Earth ephemeris, CIP/CIO and refraction constants.
25415      *
25416      *  The parameters produced by this function are required in the
25417      *  parallax, light deflection, aberration, and bias-precession-nutation
25418      *  parts of the ICRS/CIRS transformations.
25419      *
25420      *<p>This function is derived from the International Astronomical Union's
25421      *  SOFA (Standards of Fundamental Astronomy) software collection.
25422      *
25423      *<p>Status:  support function.
25424      *
25425      *<!-- Given: -->
25426      *     @param utc1    double      UTC as a 2-part...
25427      *     @param utc2    double      ...quasi Julian Date (Notes 1,2)
25428      *     @param dut1    double      UT1-UTC (seconds, Note 3)
25429      *     @param elong   double      longitude (radians, east +ve, Note 4)
25430      *     @param phi     double      latitude (geodetic, radians, Note 4)
25431      *     @param hm      double      height above ellipsoid (m, geodetic, Notes 4,6)
25432      *     @param xp double      polar motion coordinates (radians, Note 5)
25433      *     @param yp double      polar motion coordinates (radians, Note 5) 
25434      *     @param phpa    double      pressure at the observer (hPa = mB, Note 6)
25435      *     @param tc      double      ambient temperature at the observer (deg C)
25436      *     @param rh      double      relative humidity at the observer (range 0-1)
25437      *     @param wl      double      wavelength (micrometers, Note 7)
25438      *
25439      *<!-- Returned:-->
25440      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
25441      *         
25442      *     
25443      *     @return       double      <b>Returned</b> equation of the origins (ERA-GST)
25444      *
25445      *  @throws JSOFAInternalError an internal error has occured
25446      *  @throws JSOFAIllegalParameter int         status:   <b>Returned</b> +1 = dubious year (Note 2)
25447      *                                 0  =   <b>Returned</b> OK
25448      *                                -1  =   <b>Returned</b> unacceptable date
25449      *
25450      *<p>Notes:
25451      * <ol>
25452      *
25453      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
25454      *      convenient way between the two arguments, for example where utc1
25455      *      is the Julian Day Number and utc2 is the fraction of a day.
25456      *
25457      *      <p>However, JD cannot unambiguously represent UTC during a leap
25458      *      second unless special measures are taken.  The convention in the
25459      *      present function is that the JD day represents UTC days whether
25460      *      the length is 86399, 86400 or 86401 SI seconds.
25461      *
25462      *      <p>Applications should use the function iauDtf2d to convert from
25463      *      calendar date and time of day into 2-part quasi Julian Date, as
25464      *      it implements the leap-second-ambiguity convention just
25465      *      described.
25466      *
25467      *  <li> The warning status "dubious year" flags UTCs that predate the
25468      *      introduction of the time scale or that are too far in the
25469      *      future to be trusted.  See iauDat for further details.
25470      *
25471      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
25472      *      one second at the end of each positive UTC leap second,
25473      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
25474      *      practice is under review, and in the future UT1-UTC may grow
25475      *      essentially without limit.
25476      *
25477      *  <li> The geographical coordinates are with respect to the WGS84
25478      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
25479      *      longitude required by the present function is east-positive
25480      *      (i.e. right-handed), in accordance with geographical convention.
25481      *
25482      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
25483      *      values are the coordinates (in radians) of the Celestial
25484      *      Intermediate Pole with respect to the International Terrestrial
25485      *      Reference System (see IERS Conventions 2003), measured along the
25486      *      meridians 0 and 90 deg west respectively.  For many
25487      *      applications, xp and yp can be set to zero.
25488      *
25489      *      <p>Internally, the polar motion is stored in a form rotated onto
25490      *      the local meridian.
25491      *
25492      *  <li> If hm, the height above the ellipsoid of the observing station
25493      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
25494      *      available, an adequate estimate of hm can be obtained from the
25495      *      expression
25496      *
25497      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
25498      *
25499      *      <p>where tsl is the approximate sea-level air temperature in K
25500      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
25501      *      52).  Similarly, if the pressure phpa is not known, it can be
25502      *      estimated from the height of the observing station, hm, as
25503      *      follows:
25504      *
25505      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
25506      *
25507      *      <p>Note, however, that the refraction is nearly proportional to
25508      *      the pressure and that an accurate phpa value is important for
25509      *      precise work.
25510      *
25511      *  <li> The argument wl specifies the observing wavelength in
25512      *      micrometers.  The transition from optical to radio is assumed to
25513      *      occur at 100 micrometers (about 3000 GHz).
25514      *
25515      *  <li> It is advisable to take great care with units, as even unlikely
25516      *      values of the input parameters are accepted and processed in
25517      *      accordance with the models used.
25518      *
25519      *  <li> In cases where the caller wishes to supply his own Earth
25520      *      ephemeris, Earth rotation information and refraction constants,
25521      *      the function iauApco can be used instead of the present function.
25522      *
25523      *  <li> This is one of several functions that inserts into the astrom
25524      *      structure star-independent parameters needed for the chain of
25525      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25526      *
25527      *      <p>The various functions support different classes of observer and
25528      *      portions of the transformation chain:
25529      *      <pre>{@code
25530      *          functions         observer        transformation
25531      *
25532      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25533      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25534      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25535      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25536      *       iauAper iauAper13    terrestrial     update Earth rotation
25537      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25538      *      }</pre>
25539      *      <p>Those with names ending in "13" use contemporary SOFA models to
25540      *      compute the various ephemerides.  The others accept ephemerides
25541      *      supplied by the caller.
25542      *
25543      *      <p>The transformation from ICRS to GCRS covers space motion,
25544      *      parallax, light deflection, and aberration.  From GCRS to CIRS
25545      *      comprises frame bias and precession-nutation.  From CIRS to
25546      *      observed takes account of Earth rotation, polar motion, diurnal
25547      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25548      *      transformation), and atmospheric refraction.
25549      *
25550      *  <li> The context structure astrom produced by this function is used
25551      *      by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25552      *
25553      * </ol>
25554      *  Called:
25555      * <ul>
25556      *     <li>{@link #jauUtctai} UTC to TAI
25557      *     <li>{@link #jauTaitt} TAI to TT
25558      *     <li>{@link #jauUtcut1} UTC to UT1
25559      *     <li>{@link #jauEpv00} Earth position and velocity
25560      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25561      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25562      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25563      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
25564      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
25565      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
25566      *     <li>{@link #jauApco} astrometry parameters, ICRS-observed
25567      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25568      *
25569      * </ul>
25570      *@version  2013 December 5
25571      *
25572      *@since JSOFA release 20131202
25573      *
25574      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25575      * @throws JSOFAInternalError an internal error has occured
25576      * @throws JSOFAIllegalParameter 
25577      */
25578     public static double jauApco13(double utc1, double utc2, double dut1,
25579             double elong, double phi, double hm, double xp, double yp,
25580             double phpa, double tc, double rh, double wl,
25581             Astrom astrom ) throws JSOFAIllegalParameter, JSOFAInternalError
25582     {
25583         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3],
25584         r[][], s, theta, sp;
25585         double eo;
25586 
25587 
25588         /* UTC to other time scales. */
25589         JulianDate tai = jauUtctai(utc1, utc2);
25590         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
25591         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
25592 
25593         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25594         jauEpv00(tt.djm0, tt.djm1, ehpv, ebpv);
25595 
25596         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25597         r = jauPnm06a(tt.djm0, tt.djm1);
25598 
25599         /* Extract CIP X,Y. */
25600         CelestialIntermediatePole cip = jauBpn2xy(r);
25601 
25602         /* Obtain CIO locator s. */
25603         s = jauS06(tt.djm0, tt.djm1, cip.x, cip.y);
25604 
25605         /* Earth rotation angle. */
25606         theta = jauEra00(ut1.djm0, ut1.djm1);
25607 
25608         /* TIO locator s'. */
25609         sp = jauSp00(tt.djm0, tt.djm1);
25610 
25611         /* Refraction constants A and B. */
25612         RefCos ref = jauRefco(phpa, tc, rh, wl);
25613 
25614         /* Compute the star-independent astrometry parameters. */
25615         jauApco(tt.djm0, tt.djm1, ebpv, ehpv[0], cip.x, cip.y, s, theta,
25616                 elong, phi, hm, xp, yp, sp, ref.a, ref.b, astrom);
25617 
25618         /* Equation of the origins. */
25619         eo = jauEors(r, s);
25620 
25621         return eo;
25622 
25623         /* Finished. */
25624 
25625 
25626     }
25627 
25628     /**
25629      *  For an observer whose geocentric position and velocity are known,
25630      *  prepare star-independent astrometry parameters for transformations
25631      *  between ICRS and GCRS.  The Earth ephemeris is supplied by the
25632      *  caller.
25633      *
25634      *  The parameters produced by this function are required in the space
25635      *  motion, parallax, light deflection and aberration parts of the
25636      *  astrometric transformation chain.
25637      *
25638      *<p>This function is derived from the International Astronomical Union's
25639      *  SOFA (Standards of Fundamental Astronomy) software collection.
25640      *
25641      *<p>Status:  support function.
25642      *
25643      *<!-- Given: -->
25644      *     @param date1   double        TDB as a 2-part...
25645      *     @param date2   double        ...Julian Date (Note 1)
25646      *     @param pv      double[2][3]  observer's geocentric pos/vel (m, m/s)
25647      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day)
25648      *     @param ehp     double[3]     Earth heliocentric P (au)
25649      *
25650      *<!-- Returned:-->
25651      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25652 
25653      *<p>Notes:
25654      * <ol>
25655      *
25656      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25657      *     convenient way between the two arguments.  For example,
25658      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25659      *     others:
25660      *     <pre>
25661      *         date1          date2
25662      *
25663      *         2450123.7           0.0       (JD method)
25664      *         2451545.0       -1421.3       (J2000 method)
25665      *         2400000.5       50123.2       (MJD method)
25666      *         2450123.5           0.2       (date &amp; time method)
25667      *     </pre>
25668      *     <p>The JD method is the most natural and convenient to use in cases
25669      *     where the loss of several decimal digits of resolution is
25670      *     acceptable.  The J2000 method is best matched to the way the
25671      *     argument is handled internally and will deliver the optimum
25672      *     resolution.  The MJD method and the date &amp; time methods are both
25673      *     good compromises between resolution and convenience.  For most
25674      *     applications of this function the choice will not be at all
25675      *     critical.
25676      *
25677      *     <p>TT can be used instead of TDB without any significant impact on
25678      *     accuracy.
25679      *
25680      *  <li> All the vectors are with respect to BCRS axes.
25681      *
25682      *  <li> Providing separate arguments for (i) the observer's geocentric
25683      *     position and velocity and (ii) the Earth ephemeris is done for
25684      *     convenience in the geocentric, terrestrial and Earth orbit cases.
25685      *     For deep space applications it maybe more convenient to specify
25686      *     zero geocentric position and velocity and to supply the
25687      *     observer's position and velocity information directly instead of
25688      *     with respect to the Earth.  However, note the different units:
25689      *     m and m/s for the geocentric vectors, au and au/day for the
25690      *     heliocentric and barycentric vectors.
25691      *
25692      *  <li> In cases where the caller does not wish to provide the Earth
25693      *     ephemeris, the function iauApcs13 can be used instead of the
25694      *     present function.  This computes the Earth ephemeris using the
25695      *     SOFA function iauEpv00.
25696      *
25697      *  <li> This is one of several functions that inserts into the astrom
25698      *     structure star-independent parameters needed for the chain of
25699      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25700      *
25701      *     <p>The various functions support different classes of observer and
25702      *     portions of the transformation chain:
25703      *
25704      *     <pre>{@code
25705      *          functions         observer        transformation
25706      *
25707      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25708      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25709      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25710      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25711      *       iauAper iauAper13    terrestrial     update Earth rotation
25712      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25713      *     }</pre>
25714      *     <p>Those with names ending in "13" use contemporary SOFA models to
25715      *     compute the various ephemerides.  The others accept ephemerides
25716      *     supplied by the caller.
25717      *
25718      *     <p>The transformation from ICRS to GCRS covers space motion,
25719      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25720      *     comprises frame bias and precession-nutation.  From CIRS to
25721      *     observed takes account of Earth rotation, polar motion, diurnal
25722      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25723      *     transformation), and atmospheric refraction.
25724      *
25725      *  <li> The context structure astrom produced by this function is used by
25726      *     iauAtciq* and iauAticq*.
25727      *
25728      * </ol>
25729      *  Called:
25730      * <ul>
25731      *     <li>{@link #jauCp} copy p-vector
25732      *     <li>{@link #jauPm} modulus of p-vector
25733      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
25734      *     <li>{@link #jauIr} initialize r-matrix to identity
25735      *
25736      * </ul>
25737      *@version  2013 October 9
25738      *
25739      *@since JSOFA release 20131202
25740      *
25741      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25742      */
25743     public static void jauApcs(double date1, double date2, double pv[][],
25744             double ebpv[][], double ehp[],
25745             Astrom astrom)
25746     {
25747         /* au/d to m/s */
25748         final double AUDMS = DAU/DAYSEC;
25749 
25750         /* Light time for 1 au (day) */
25751         final double CR = AULT/DAYSEC;
25752 
25753         int i;
25754         double dp, dv, pb[] = new double[3], vb[] = new double[3], ph[] = new double[3], v2, w;
25755 
25756 
25757         /* Time since reference epoch, years (for proper motion calculation). */
25758         astrom.pmt = ( (date1 - DJ00) + date2 ) / DJY;
25759 
25760         /* Adjust Earth ephemeris to observer. */
25761         for (i = 0; i < 3; i++) {
25762             dp = pv[0][i] / DAU;
25763             dv = pv[1][i] / AUDMS;
25764             pb[i] = ebpv[0][i] + dp;
25765             vb[i] = ebpv[1][i] + dv;
25766             ph[i] = ehp[i] + dp;
25767         }
25768 
25769         /* Barycentric position of observer (au). */
25770         jauCp(pb, astrom.eb);
25771 
25772         /* Heliocentric direction and distance (unit vector and au). */
25773         NormalizedVector nv = jauPn(ph);
25774         
25775         astrom.em = nv.r;
25776         astrom.eh = nv.u;
25777 
25778         /* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
25779         v2 = 0.0;
25780         for (i = 0; i < 3; i++) {
25781             w = vb[i] * CR;
25782             astrom.v[i] = w;
25783             v2 += w*w;
25784         }
25785         astrom.bm1 = sqrt(1.0 - v2);
25786 
25787         /* Reset the NPB matrix. */
25788         jauIr(astrom.bpn);
25789 
25790         /* Finished. */
25791 
25792 
25793     }
25794 
25795     /**
25796      *  For an observer whose geocentric position and velocity are known,
25797      *  prepare star-independent astrometry parameters for transformations
25798      *  between ICRS and GCRS.  The Earth ephemeris is from SOFA models.
25799      *
25800      *  The parameters produced by this function are required in the space
25801      *  motion, parallax, light deflection and aberration parts of the
25802      *  astrometric transformation chain.
25803      *
25804      *<p>This function is derived from the International Astronomical Union's
25805      *  SOFA (Standards of Fundamental Astronomy) software collection.
25806      *
25807      *<p>Status:  support function.
25808      *
25809      *<!-- Given: -->
25810      *     @param date1   double        TDB as a 2-part...
25811      *     @param date2   double        ...Julian Date (Note 1)
25812      *     @param pv      double[2][3]  observer's geocentric pos/vel (Note 3)
25813      *
25814      *<!-- Returned:-->
25815      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25816      *
25817      *<p>Notes:
25818      * <ol>
25819      *
25820      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25821      *     convenient way between the two arguments.  For example,
25822      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25823      *     others:
25824      *     <pre>
25825      *           date1          date2
25826      *
25827      *         2450123.7           0.0       (JD method)
25828      *         2451545.0       -1421.3       (J2000 method)
25829      *         2400000.5       50123.2       (MJD method)
25830      *         2450123.5           0.2       (date &amp; time method)
25831      *     </pre>
25832      *     <p>The JD method is the most natural and convenient to use in cases
25833      *     where the loss of several decimal digits of resolution is
25834      *     acceptable.  The J2000 method is best matched to the way the
25835      *     argument is handled internally and will deliver the optimum
25836      *     resolution.  The MJD method and the date &amp; time methods are both
25837      *     good compromises between resolution and convenience.  For most
25838      *     applications of this function the choice will not be at all
25839      *     critical.
25840      *
25841      *     <p>TT can be used instead of TDB without any significant impact on
25842      *     accuracy.
25843      *
25844      *  <li> All the vectors are with respect to BCRS axes.
25845      *
25846      *  <li> The observer's position and velocity pv are geocentric but with
25847      *     respect to BCRS axes, and in units of m and m/s.  No assumptions
25848      *     are made about proximity to the Earth, and the function can be
25849      *     used for deep space applications as well as Earth orbit and
25850      *     terrestrial.
25851      *
25852      *  <li> In cases where the caller wishes to supply his own Earth
25853      *     ephemeris, the function iauApcs can be used instead of the present
25854      *     function.
25855      *
25856      *  <li> This is one of several functions that inserts into the astrom
25857      *     structure star-independent parameters needed for the chain of
25858      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25859      *
25860      *     <p>The various functions support different classes of observer and
25861      *     portions of the transformation chain:
25862      *     <pre>{@code
25863      *          functions         observer        transformation
25864      *
25865      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25866      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25867      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25868      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25869      *       iauAper iauAper13    terrestrial     update Earth rotation
25870      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25871      *     }</pre>
25872      *     <p>Those with names ending in "13" use contemporary SOFA models to
25873      *     compute the various ephemerides.  The others accept ephemerides
25874      *     supplied by the caller.
25875      *
25876      *     <p>The transformation from ICRS to GCRS covers space motion,
25877      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25878      *     comprises frame bias and precession-nutation.  From CIRS to
25879      *     observed takes account of Earth rotation, polar motion, diurnal
25880      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25881      *     transformation), and atmospheric refraction.
25882      *
25883      *  <li> The context structure astrom produced by this function is used by
25884      *     iauAtciq* and iauAticq*.
25885      *
25886      * </ol>
25887      *  Called:
25888      * <ul>
25889      *     <li>{@link #jauEpv00} Earth position and velocity
25890      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
25891      *
25892      * </ul>
25893      *@version  2013 October 9
25894      *
25895      *@since JSOFA release 20131202
25896      *
25897      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25898      */
25899     public static void jauApcs13(double date1, double date2, double pv[][],
25900             Astrom astrom)
25901     {
25902         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
25903 
25904 
25905         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25906         jauEpv00(date1, date2, ehpv, ebpv);
25907 
25908         /* Compute the star-independent astrometry parameters. */
25909         jauApcs(date1, date2, pv, ebpv, ehpv[0], astrom);
25910 
25911         /* Finished. */
25912 
25913 
25914     }
25915 
25916     /**
25917      *  In the star-independent astrometry parameters, update only the
25918      *  Earth rotation angle, supplied by the caller explicitly.
25919      *
25920      *<p>This function is derived from the International Astronomical Union's
25921      *  SOFA (Standards of Fundamental Astronomy) software collection.
25922      *
25923      *<p>Status:  support function.
25924      *
25925      *<!-- Given: -->
25926      *     @param theta    double       Earth rotation angle (radians, Note 2)
25927      *     @param astrom  Astrom    star-independent astrometry parameters:{@code
25928      *          pmt     double        not used
25929      *          eb      double[3]     not used
25930      *          eh      double[3]     not used
25931      *          em      double        not used
25932      *          v       double[3]     not used
25933      *          bm1     double        not used
25934      *          bpn     double[3][3]  not used
25935      *          along   double        longitude + s' (radians)
25936      *          xpl     double        not used
25937      *          ypl     double        not used
25938      *          sphi    double        not used
25939      *          cphi    double        not used
25940      *          diurab  double        not used
25941      *          eral    double        not used
25942      *          refa    double        not used
25943      *          refb    double        not used}
25944      *
25945      *<!-- Returned:-->
25946      *     astrom       <b>Returned</b> star-independent astrometry parameters:
25947     *
25948      *<p>Notes:
25949      * <ol>
25950      *
25951      *  <li> This function exists to enable sidereal-tracking applications to
25952      *     avoid wasteful recomputation of the bulk of the astrometry
25953      *     parameters:  only the Earth rotation is updated.
25954      *
25955      *  <li> For targets expressed as equinox based positions, such as
25956      *     classical geocentric apparent (RA,Dec), the supplied theta can be
25957      *     Greenwich apparent sidereal time rather than Earth rotation
25958      *     angle.
25959      *
25960      *  <li> The function iauAper13 can be used instead of the present
25961      *     function, and starts from UT1 rather than ERA itself.
25962      *
25963      *  <li> This is one of several functions that inserts into the astrom
25964      *     structure star-independent parameters needed for the chain of
25965      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25966      *
25967      *     <p>The various functions support different classes of observer and
25968      *     portions of the transformation chain:
25969      *     <pre>{@code
25970      *          functions         observer        transformation
25971      *
25972      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25973      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25974      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25975      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25976      *       iauAper iauAper13    terrestrial     update Earth rotation
25977      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25978      *     }</pre>
25979      *     <p>Those with names ending in "13" use contemporary SOFA models to
25980      *     compute the various ephemerides.  The others accept ephemerides
25981      *     supplied by the caller.
25982      *
25983      *     <p>The transformation from ICRS to GCRS covers space motion,
25984      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25985      *     comprises frame bias and precession-nutation.  From CIRS to
25986      *     observed takes account of Earth rotation, polar motion, diurnal
25987      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25988      *     transformation), and atmospheric refraction.
25989      *
25990      * </ol>
25991      *@version  2013 September 25
25992      *
25993      *@since JSOFA release 20131202
25994      *
25995      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25996      */
25997     public static void jauAper(double theta, Astrom astrom)
25998     {
25999         astrom.eral = theta + astrom.along;
26000 
26001         /* Finished. */
26002 
26003 
26004     }
26005 
26006     /**
26007      *  In the star-independent astrometry parameters, update only the
26008      *  Earth rotation angle.  The caller provides UT1, (n.b. not UTC).
26009      *
26010      *<p>This function is derived from the International Astronomical Union's
26011      *  SOFA (Standards of Fundamental Astronomy) software collection.
26012      *
26013      *<p>Status:  support function.
26014      *
26015      *<!-- Given: -->
26016      *     @param ut11     double       UT1 as a 2-part...
26017      *     @param ut12     double       ...Julian Date (Note 1)
26018      *     @param astrom      star-independent astrometry parameters:
26019      *                    pmt     double        not used
26020      *                    eb      double[3]     not used
26021      *                    eh      double[3]     not used
26022      *                    em      double        not used
26023      *                    v       double[3]     not used
26024      *                    bm1     double        not used
26025      *                    bpn     double[3][3]  not used
26026      *                    along   double        longitude + s' (radians)
26027      *                    xpl     double        not used
26028      *                    ypl     double        not used
26029      *                    sphi    double        not used
26030      *                    cphi    double        not used
26031      *                    diurab  double        not used
26032      *                    eral    double        not used
26033      *                    refa    double        not used
26034      *                    refb    double        not used
26035      *
26036      *<!-- Returned:-->
26037      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
26038      *
26039      *<p>Notes:
26040      * <ol>
26041      *
26042      *  <li> The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
26043      *     apportioned in any convenient way between the arguments ut11 and
26044      *     ut12.  For example, JD(UT1)=2450123.7 could be expressed in any
26045      *     of these ways, among others:
26046      *
26047      *            <p>ut11           ut12
26048      *
26049      *         2450123.7           0.0       (JD method)
26050      *         2451545.0       -1421.3       (J2000 method)
26051      *         2400000.5       50123.2       (MJD method)
26052      *         2450123.5           0.2       (date &amp; time method)
26053      *
26054      *     <p>The JD method is the most natural and convenient to use in cases
26055      *     where the loss of several decimal digits of resolution is
26056      *     acceptable.  The J2000 and MJD methods are good compromises
26057      *     between resolution and convenience.  The date &amp; time method is
26058      *     best matched to the algorithm used:  maximum precision is
26059      *     delivered when the ut11 argument is for 0hrs UT1 on the day in
26060      *     question and the ut12 argument lies in the range 0 to 1, or vice
26061      *     versa.
26062      *
26063      *  <li> If the caller wishes to provide the Earth rotation angle itself,
26064      *     the function iauAper can be used instead.  One use of this
26065      *     technique is to substitute Greenwich apparent sidereal time and
26066      *     thereby to support equinox based transformations directly.
26067      *
26068      *  <li> This is one of several functions that inserts into the astrom
26069      *     structure star-independent parameters needed for the chain of
26070      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26071      *
26072      *     <p>The various functions support different classes of observer and
26073      *     portions of the transformation chain:
26074      *     <pre>{@code
26075      *          functions         observer        transformation
26076      *
26077      *       <p>iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26078      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26079      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26080      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26081      *       iauAper iauAper13    terrestrial     update Earth rotation
26082      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26083      *     }</pre>
26084      *     <p>Those with names ending in "13" use contemporary SOFA models to
26085      *     compute the various ephemerides.  The others accept ephemerides
26086      *     supplied by the caller.
26087      *
26088      *     <p>The transformation from ICRS to GCRS covers space motion,
26089      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26090      *     comprises frame bias and precession-nutation.  From CIRS to
26091      *     observed takes account of Earth rotation, polar motion, diurnal
26092      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26093      *     transformation), and atmospheric refraction.
26094      *
26095      * </ol>
26096      *  Called:
26097      * <ul>
26098      *     <li>{@link #jauAper} astrometry parameters: update ERA
26099      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26100      *
26101      * </ul>
26102      *@version  2013 September 25
26103      *
26104      *@since JSOFA release 20131202
26105      *
26106      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26107      */
26108     public static void jauAper13(double ut11, double ut12, Astrom astrom)
26109     {
26110         jauAper(jauEra00(ut11,ut12), astrom);
26111 
26112         /* Finished. */
26113 
26114 
26115     }
26116 
26117     /**
26118      *  For a terrestrial observer, prepare star-independent astrometry
26119      *  parameters for transformations between CIRS and observed
26120      *  coordinates.  The caller supplies the Earth orientation information
26121      *  and the refraction constants as well as the site coordinates.
26122      *
26123      *<p>This function is derived from the International Astronomical Union's
26124      *  SOFA (Standards of Fundamental Astronomy) software collection.
26125      *
26126      *<p>Status:  support function.
26127      *
26128      *<!-- Given: -->
26129      *     @param sp      double       the TIO locator s' (radians, Note 1)
26130      *     @param theta   double       Earth rotation angle (radians)
26131      *     @param elong   double       longitude (radians, east +ve, Note 2)
26132      *     @param phi     double       geodetic latitude (radians, Note 2)
26133      *     @param hm      double       height above ellipsoid (m, geodetic Note 2)
26134      *     @param xp double       polar motion coordinates (radians, Note 3)
26135      *     @param yp double       polar motion coordinates (radians, Note 3) 
26136      *     @param refa    double       refraction constant A (radians, Note 4)
26137      *     @param refb    double       refraction constant B (radians, Note 4)
26138      *
26139      *<!-- Returned:-->
26140      *     @param astrom  {@link Astrom}    <b>Returned</b> star-independent astrometry parameters:
26141      *     
26142      *<p>Notes:
26143      * <ol>
26144      *
26145      *  <li> sp, the TIO locator s', is a tiny quantity needed only by the
26146      *     most precise applications.  It can either be set to zero or
26147      *     predicted using the SOFA function iauSp00.
26148      *
26149      *  <li> The geographical coordinates are with respect to the WGS84
26150      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26151      *     longitude required by the present function is east-positive
26152      *     (i.e. right-handed), in accordance with geographical convention.
26153      *
26154      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26155      *     values are the coordinates (in radians) of the Celestial
26156      *     Intermediate Pole with respect to the International Terrestrial
26157      *     Reference System (see IERS Conventions 2003), measured along the
26158      *     meridians 0 and 90 deg west respectively.  For many applications,
26159      *     xp and yp can be set to zero.
26160      *
26161      *     <p>Internally, the polar motion is stored in a form rotated onto the
26162      *     local meridian.
26163      *
26164      *  <li> The refraction constants refa and refb are for use in a
26165      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
26166      *     (i.e. refracted) zenith distance and dZ is the amount of
26167      *     refraction.
26168      *
26169      *  <li> It is advisable to take great care with units, as even unlikely
26170      *     values of the input parameters are accepted and processed in
26171      *     accordance with the models used.
26172      *
26173      *  <li> In cases where the caller does not wish to provide the Earth
26174      *     rotation information and refraction constants, the function
26175      *     iauApio13 can be used instead of the present function.  This
26176      *     starts from UTC and weather readings etc. and computes suitable
26177      *     values using other SOFA functions.
26178      *
26179      *  <li> This is one of several functions that inserts into the astrom
26180      *     structure star-independent parameters needed for the chain of
26181      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26182      *
26183      *     <p>The various functions support different classes of observer and
26184      *     portions of the transformation chain:
26185      *<pre>{@code
26186      *          functions         observer        transformation
26187      *
26188      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26189      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26190      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26191      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26192      *       iauAper iauAper13    terrestrial     update Earth rotation
26193      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26194      *}</pre>
26195      *     <p>Those with names ending in "13" use contemporary SOFA models to
26196      *     compute the various ephemerides.  The others accept ephemerides
26197      *     supplied by the caller.
26198      *
26199      *     <p>The transformation from ICRS to GCRS covers space motion,
26200      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26201      *     comprises frame bias and precession-nutation.  From CIRS to
26202      *     observed takes account of Earth rotation, polar motion, diurnal
26203      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26204      *     transformation), and atmospheric refraction.
26205      *
26206      *  <li> The context structure astrom produced by this function is used by
26207      *     iauAtioq and iauAtoiq.
26208      *
26209      * </ol>
26210      *  Called:
26211      * <ul>
26212      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
26213      *     <li>{@link #jauAper} astrometry parameters: update ERA
26214      *
26215      * </ul>
26216      *@version  2013 October 9
26217      *
26218      *@since JSOFA release 20131202
26219      *
26220      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26221      * @throws JSOFAInternalError an internal error has occured
26222      * @throws JSOFAIllegalParameter 
26223      */
26224     public static void jauApio(double sp, double theta,
26225             double elong, double phi, double hm, double xp, double yp,
26226             double refa, double refb,
26227             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26228     {
26229         double sl, cl, pv[][];
26230 
26231 
26232         /* Longitude with adjustment for TIO locator s'. */
26233         astrom.along = elong + sp;
26234 
26235         /* Polar motion, rotated onto the local meridian. */
26236         sl = sin(astrom.along);
26237         cl = cos(astrom.along);
26238         astrom.xpl = xp*cl - yp*sl;
26239         astrom.ypl = xp*sl + yp*cl;
26240 
26241         /* Functions of latitude. */
26242         astrom.sphi = sin(phi);
26243         astrom.cphi = cos(phi);
26244 
26245         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
26246         pv = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
26247 
26248         /* Magnitude of diurnal aberration vector. */
26249         astrom.diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
26250 
26251         /* Refraction constants. */
26252         astrom.refa = refa;
26253         astrom.refb = refb;
26254 
26255         /* Local Earth rotation angle. */
26256         jauAper(theta, astrom);
26257 
26258         /* Finished. */
26259 
26260 
26261     }
26262 
26263     /**
26264      *  For a terrestrial observer, prepare star-independent astrometry
26265      *  parameters for transformations between CIRS and observed
26266      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
26267      *  conditions and observing wavelength.
26268      *
26269      *<p>This function is derived from the International Astronomical Union's
26270      *  SOFA (Standards of Fundamental Astronomy) software collection.
26271      *
26272      *<p>Status:  support function.
26273      *
26274      *<!-- Given: -->
26275      *     @param utc1    double       UTC as a 2-part...
26276      *     @param utc2    double       ...quasi Julian Date (Notes 1,2)
26277      *     @param dut1    double       UT1-UTC (seconds)
26278      *     @param elong   double       longitude (radians, east +ve, Note 3)
26279      *     @param phi     double       geodetic latitude (radians, Note 3)
26280      *     @param hm      double       height above ellipsoid (m, geodetic Notes 4,6)
26281      *     @param xp double       polar motion coordinates (radians, Note 5)
26282      *     @param yp double       polar motion coordinates (radians, Note 5) 
26283      *     @param phpa    double       pressure at the observer (hPa = mB, Note 6)
26284      *     @param tc      double       ambient temperature at the observer (deg C)
26285      *     @param rh      double       relative humidity at the observer (range 0-1)
26286      *     @param wl      double       wavelength (micrometers, Note 7)
26287      *
26288      *<!-- Returned:-->
26289      *     @param astrom      <b>Returned</b> star-independent astrometry parameters:
26290      *     @throws JSOFAInternalError an internal error has occured
26291      *     @throws JSOFAIllegalParameter int          status:   <b>Returned</b> +1 = dubious year (Note 2)
26292      *                                  0  =   <b>Returned</b> OK
26293      *                                 -1  =   <b>Returned</b> unacceptable date
26294      *
26295      *<p>Notes:
26296      * <ol>
26297      *
26298      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
26299      *      convenient way between the two arguments, for example where utc1
26300      *      is the Julian Day Number and utc2 is the fraction of a day.
26301      *
26302      *      <p>However, JD cannot unambiguously represent UTC during a leap
26303      *      second unless special measures are taken.  The convention in the
26304      *      present function is that the JD day represents UTC days whether
26305      *      the length is 86399, 86400 or 86401 SI seconds.
26306      *
26307      *      <p>Applications should use the function iauDtf2d to convert from
26308      *      calendar date and time of day into 2-part quasi Julian Date, as
26309      *      it implements the leap-second-ambiguity convention just
26310      *      described.
26311      *
26312      *  <li> The warning status "dubious year" flags UTCs that predate the
26313      *      introduction of the time scale or that are too far in the future
26314      *      to be trusted.  See iauDat for further details.
26315      *
26316      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
26317      *      one second at the end of each positive UTC leap second,
26318      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
26319      *      practice is under review, and in the future UT1-UTC may grow
26320      *      essentially without limit.
26321      *
26322      *  <li> The geographical coordinates are with respect to the WGS84
26323      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26324      *      longitude required by the present function is east-positive
26325      *      (i.e. right-handed), in accordance with geographical convention.
26326      *
26327      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26328      *      values are the coordinates (in radians) of the Celestial
26329      *      Intermediate Pole with respect to the International Terrestrial
26330      *      Reference System (see IERS Conventions 2003), measured along the
26331      *      meridians 0 and 90 deg west respectively.  For many applications,
26332      *      xp and yp can be set to zero.
26333      *
26334      *      <p>Internally, the polar motion is stored in a form rotated onto
26335      *      the local meridian.
26336      *
26337      *  <li> If hm, the height above the ellipsoid of the observing station
26338      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
26339      *      available, an adequate estimate of hm can be obtained from the
26340      *      expression
26341      *
26342      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
26343      *
26344      *      <p>where tsl is the approximate sea-level air temperature in K
26345      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
26346      *      52).  Similarly, if the pressure phpa is not known, it can be
26347      *      estimated from the height of the observing station, hm, as
26348      *      follows:
26349      *
26350      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
26351      *
26352      *      <p>Note, however, that the refraction is nearly proportional to the
26353      *      pressure and that an accurate phpa value is important for
26354      *      precise work.
26355      *
26356      *  <li> The argument wl specifies the observing wavelength in
26357      *      micrometers.  The transition from optical to radio is assumed to
26358      *      occur at 100 micrometers (about 3000 GHz).
26359      *
26360      *  <li> It is advisable to take great care with units, as even unlikely
26361      *      values of the input parameters are accepted and processed in
26362      *      accordance with the models used.
26363      *
26364      *  <li> In cases where the caller wishes to supply his own Earth
26365      *      rotation information and refraction constants, the function
26366      *      iauApc can be used instead of the present function.
26367      *
26368      *  <li> This is one of several functions that inserts into the astrom
26369      *      structure star-independent parameters needed for the chain of
26370      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26371      *
26372      *      <p>The various functions support different classes of observer and
26373      *      portions of the transformation chain:
26374      *      <pre>{@code
26375      *          functions         observer        transformation
26376      *
26377      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26378      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26379      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26380      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26381      *       iauAper iauAper13    terrestrial     update Earth rotation
26382      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26383      *      }</pre>
26384      *      <p>Those with names ending in "13" use contemporary SOFA models to
26385      *      compute the various ephemerides.  The others accept ephemerides
26386      *      supplied by the caller.
26387      *
26388      *      <p>The transformation from ICRS to GCRS covers space motion,
26389      *      parallax, light deflection, and aberration.  From GCRS to CIRS
26390      *      comprises frame bias and precession-nutation.  From CIRS to
26391      *      observed takes account of Earth rotation, polar motion, diurnal
26392      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26393      *      transformation), and atmospheric refraction.
26394      *
26395      *  <li> The context structure astrom produced by this function is used
26396      *      by iauAtioq and iauAtoiq.
26397      *
26398      * </ol>
26399      *  Called:
26400      * <ul>
26401      *     <li>{@link #jauUtctai} UTC to TAI
26402      *     <li>{@link #jauTaitt} TAI to TT
26403      *     <li>{@link #jauUtcut1} UTC to UT1
26404      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
26405      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26406      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
26407      *     <li>{@link #jauApio} astrometry parameters, CIRS-observed
26408      *
26409      * </ul>
26410      *@version  2013 October 9
26411      *
26412      *@since JSOFA release 20131202
26413      *
26414      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26415      * @throws JSOFAInternalError an internal error has occured
26416      * @throws JSOFAIllegalParameter 
26417      */
26418     public static void jauApio13(double utc1, double utc2, double dut1,
26419             double elong, double phi, double hm, double xp, double yp,
26420             double phpa, double tc, double rh, double wl,
26421             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26422     {
26423         double sp, theta;
26424 
26425 
26426         /* UTC to other time scales. */
26427         JulianDate tai = jauUtctai(utc1, utc2);
26428         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
26429         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
26430 
26431         /* TIO locator s'. */
26432         sp = jauSp00(tt.djm0, tt.djm1);
26433 
26434         /* Earth rotation angle. */
26435         theta = jauEra00(ut1.djm0, ut1.djm1);
26436 
26437         /* Refraction constants A and B. */
26438         RefCos refco = jauRefco(phpa, tc, rh, wl);
26439 
26440         /* CIRS <-> observed astrometry parameters. */
26441         jauApio(sp, theta, elong, phi, hm, xp, yp, refco.a, refco.b, astrom);
26442 
26443        
26444         /* Finished. */
26445 
26446 
26447     }
26448 
26449     /**
26450      *  Transform ICRS star data, epoch J2000.0, to CIRS.
26451      *
26452      *<p>This function is derived from the International Astronomical Union's
26453      *  SOFA (Standards of Fundamental Astronomy) software collection.
26454      *
26455      *<p>Status:  support function.
26456      *
26457      *<!-- Given: -->
26458      *     @param rc      double    ICRS right ascension at J2000.0 (radians, Note 1)
26459      *     @param dc      double    ICRS declination at J2000.0 (radians, Note 1)
26460      *     @param pr      double    RA proper motion (radians/year; Note 2)
26461      *     @param pd      double    Dec proper motion (radians/year)
26462      *     @param px      double    parallax (arcsec)
26463      *     @param rv      double    radial velocity (km/s, +ve if receding)
26464      *     @param date1   double    TDB as a 2-part...
26465      *     @param date2   double    ...Julian Date (Note 3)
26466      *
26467      *<!-- Returned:-->
26468      *     @return    double*    <b>Returned</b> CIRS geocentric RA,Dec (radians)
26469      *        eo      double*    <b>Returned</b> equation of the origins (ERA-GST, Note 5)
26470      *
26471      *<p>Notes:
26472      * <ol>
26473      *
26474      *  <li> Star data for an epoch other than J2000.0 (for example from the
26475      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26476      *     preliminary call to iauPmsafe before use.
26477      *
26478      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26479      *
26480      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
26481      *     convenient way between the two arguments.  For example,
26482      *     JD(TDB)=2450123.8g could be expressed in any of these ways, among
26483      *     others:
26484      *
26485      *            date1          date2
26486      *
26487      *         2450123.8g           0.0       (JD method)
26488      *         2451545.0       -1421.3       (J2000 method)
26489      *         2400000.5       50123.2       (MJD method)
26490      *         2450123.5           0.2       (date &amp; time method)
26491      *
26492      *     <p>The JD method is the most natural and convenient to use in cases
26493      *     where the loss of several decimal digits of resolution is
26494      *     acceptable.  The J2000 method is best matched to the way the
26495      *     argument is handled internally and will deliver the optimum
26496      *     resolution.  The MJD method and the date &amp; time methods are both
26497      *     good compromises between resolution and convenience.  For most
26498      *     applications of this function the choice will not be at all
26499      *     critical.
26500      *
26501      *     <p>TT can be used instead of TDB without any significant impact on
26502      *     accuracy.
26503      *
26504      *  <li> The available accuracy is better than 1 milliarcsecond, limited
26505      *     mainly by the precession-nutation model that is used, namely
26506      *     IAU 2000A/2006.  Very close to solar system bodies, additional
26507      *     errors of up to several milliarcseconds can occur because of
26508      *     unmodeled light deflection;  however, the Sun's contribution is
26509      *     taken into account, to first order.  The accuracy limitations of
26510      *     the SOFA function iauEpv00 (used to compute Earth position and
26511      *     velocity) can contribute aberration errors of up to
26512      *     5 microarcseconds.  Light deflection at the Sun's limb is
26513      *     uncertain at the 0.4 mas level.
26514      *
26515      *  <li> Should the transformation to (equinox based) apparent place be
26516      *     required rather than (CIO based) intermediate place, subtract the
26517      *     equation of the origins from the returned right ascension:
26518      *     RA = RI - EO. (The iauAnp function can then be applied, as
26519      *     required, to keep the result in the conventional 0-2pi range.)
26520      *
26521      * </ol>
26522      *  Called:
26523      * <ul>
26524      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
26525      *     <li>{@link #jauAtciq} quick ICRS to CIRS
26526      *
26527      * </ul>
26528      *@version  2013 October 9
26529      *
26530      *@since JSOFA release 20131202
26531      *
26532      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26533      */
26534     public static SphericalCoordinateEO jauAtci13(double rc, double dc,
26535             double pr, double pd, double px, double rv,
26536             double date1, double date2)
26537     {
26538         /* Star-independent astrometry parameters */
26539         Astrom astrom = new Astrom();
26540 
26541 
26542         /* The transformation parameters. */
26543         double eo = jauApci13(date1, date2, astrom);
26544 
26545         /* ICRS (epoch J2000.0) to CIRS. */
26546         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
26547         
26548         return new SphericalCoordinateEO(co, eo);
26549         /* Finished. */
26550 
26551 
26552     }
26553 
26554     /**
26555      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26556      *  star-independent astrometry parameters.
26557      *
26558      *  Use of this function is appropriate when efficiency is important and
26559      *  where many star positions are to be transformed for one date.  The
26560      *  star-independent parameters can be obtained by calling one of the
26561      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26562      *
26563      *  If the parallax and proper motions are zero the iauAtciqz function
26564      *  can be used instead.
26565      *
26566      *<p>This function is derived from the International Astronomical Union's
26567      *  SOFA (Standards of Fundamental Astronomy) software collection.
26568      *
26569      *<p>Status:  support function.
26570      *
26571      *<!-- Given: -->
26572      *     @param rc double      ICRS RA,Dec at J2000.0 (radians)
26573      *     @param dc double      ICRS RA,Dec at J2000.0 (radians) 
26574      *     @param pr      double      RA proper motion (radians/year; Note 3)
26575      *     @param pd      double      Dec proper motion (radians/year)
26576      *     @param px      double      parallax (arcsec)
26577      *     @param rv      double      radial velocity (km/s, +ve if receding)
26578      *     @param astrom    star-independent astrometry parameters:
26579      *
26580      *<!-- Returned:-->
26581      *     @return     double      <b>Returned</b> CIRS RA,Dec (radians)
26582      *
26583      *<p>Notes:
26584      * <ol>
26585      *
26586      *  <li> All the vectors are with respect to BCRS axes.
26587      *
26588      *  <li> Star data for an epoch other than J2000.0 (for example from the
26589      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26590      *     preliminary call to iauPmsafe before use.
26591      *
26592      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26593      *
26594      * </ol>
26595      *  Called:
26596      * <ul>
26597      *     <li>{@link #jauPmpx} proper motion and parallax
26598      *     <li>{@link #jauLdsun} light deflection by the Sun
26599      *     <li>{@link #jauAb} stellar aberration
26600      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26601      *     <li>{@link #jauC2s} p-vector to spherical
26602      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26603      *
26604      * </ul>
26605      *@version  2013 October 9
26606      *
26607      *@since JSOFA release 20131202
26608      *
26609      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26610      */
26611     public static SphericalCoordinate jauAtciq(double rc, double dc,
26612             double pr, double pd, double px, double rv,
26613             Astrom astrom)
26614     {
26615         double pco[], pnat[], ppr[], pi[];
26616 
26617 
26618         /* Proper motion and parallax, giving BCRS coordinate direction. */
26619         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26620 
26621         /* Light deflection by the Sun, giving BCRS natural direction. */
26622         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26623 
26624         /* Aberration, giving GCRS proper direction. */
26625         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26626 
26627         /* Bias-precession-nutation, giving CIRS proper direction. */
26628         pi = jauRxp(astrom.bpn, ppr);
26629 
26630         /* CIRS RA,Dec. */
26631         SphericalCoordinate co = jauC2s(pi);
26632         co.alpha = jauAnp(co.alpha);
26633 
26634         return co;
26635         /* Finished. */
26636 
26637 
26638     }
26639 
26640     /**
26641      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26642      *  star-independent astrometry parameters plus a list of light-
26643      *  deflecting bodies.
26644      *
26645      *  Use of this function is appropriate when efficiency is important and
26646      *  where many star positions are to be transformed for one date.  The
26647      *  star-independent parameters can be obtained by calling one of the
26648      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26649      *
26650      *
26651      *  If the only light-deflecting body to be taken into account is the
26652      *  Sun, the iauAtciq function can be used instead.  If in addition the
26653      *  parallax and proper motions are zero, the iauAtciqz function can be
26654      *  used.
26655      *
26656      *<p>This function is derived from the International Astronomical Union's
26657      *  SOFA (Standards of Fundamental Astronomy) software collection.
26658      *
26659      *<p>Status:  support function.
26660      *
26661      *<!-- Given: -->
26662      *     @param rc double        ICRS RA,Dec at J2000.0 (radians)
26663      *     @param dc double        ICRS RA,Dec at J2000.0 (radians) 
26664      *     @param pr      double        RA proper motion (radians/year; Note 3)
26665      *     @param pd      double        Dec proper motion (radians/year)
26666      *     @param px      double        parallax (arcsec)
26667      *     @param rv      double        radial velocity (km/s, +ve if receding)
26668      *     @param astrom      star-independent astrometry parameters:
26669      *      @param n      int            number of bodies (Note 3)
26670      *      @param b      jauLDBODY[n]  data for each of the n bodies (Notes 3,4):
26671      *
26672      *<!-- Returned:-->
26673      *     @return ri,di    double      <b>Returned</b> CIRS RA,Dec (radians)
26674      *
26675      *<p>Notes:
26676      * <ol>
26677      *
26678      *  <li> Star data for an epoch other than J2000.0 (for example from the
26679      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26680      *     preliminary call to iauPmsafe before use.
26681      *
26682      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26683      *
26684      *  <li> The struct b contains n entries, one for each body to be
26685      *     considered.  If n = 0, no gravitational light deflection will be
26686      *     applied, not even for the Sun.
26687      *
26688      *  <li> The struct b should include an entry for the Sun as well as for
26689      *     any planet or other body to be taken into account.  The entries
26690      *     should be in the order in which the light passes the body.
26691      *
26692      *  <li> In the entry in the b struct for body i, the mass parameter
26693      *     b[i].bm can, as required, be adjusted in order to allow for such
26694      *     effects as quadrupole field.
26695      *
26696      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
26697      *     the angular separation (in radians) between star and body at
26698      *     which limiting is applied.  As phi shrinks below the chosen
26699      *     threshold, the deflection is artificially reduced, reaching zero
26700      *     for phi = 0.   Example values suitable for a terrestrial
26701      *     observer, together with masses, are as follows:
26702      *     <pre>
26703      *        body i     b[i].bm        b[i].dl
26704      *
26705      *        Sun        1.0            6e-6
26706      *        Jupiter    0.00095435     3e-9
26707      *        Saturn     0.00028574     3e-10
26708      *     </pre>
26709      *  <li> For efficiency, validation of the contents of the b array is
26710      *     omitted.  The supplied masses must be greater than zero, the
26711      *     position and velocity vectors must be right, and the deflection
26712      *     limiter greater than zero.
26713      *
26714      * </ol>
26715      *  Called:
26716      * <ul>
26717      *     <li>{@link #jauPmpx} proper motion and parallax
26718      *     <li>{@link #jauLdn} light deflection by n bodies
26719      *     <li>{@link #jauAb} stellar aberration
26720      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26721      *     <li>{@link #jauC2s} p-vector to spherical
26722      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26723      *
26724      * </ul>
26725      *@version  2013 October 9
26726      *
26727      *@since JSOFA release 20131202
26728      *
26729      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26730      */
26731     public static SphericalCoordinate jauAtciqn(double rc, double dc, double pr, double pd,
26732             double px, double rv, Astrom astrom,
26733             int n, Ldbody b[])
26734     {
26735         double pco[], pnat[], ppr[] = new double[3], pi[] = new double[3];
26736 
26737 
26738         /* Proper motion and parallax, giving BCRS coordinate direction. */
26739         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26740 
26741         /* Light deflection, giving BCRS natural direction. */
26742         pnat = jauLdn(n, b, astrom.eb, pco);
26743 
26744         /* Aberration, giving GCRS proper direction. */
26745         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26746 
26747         /* Bias-precession-nutation, giving CIRS proper direction. */
26748         pi = jauRxp(astrom.bpn, ppr);
26749 
26750         /* CIRS RA,Dec. */
26751         SphericalCoordinate co = jauC2s(pi);
26752         co.alpha = jauAnp(co.alpha);
26753 
26754         return co;
26755         /* Finished. */
26756 
26757 
26758     }
26759 
26760     /**
26761      *  Quick ICRS to CIRS transformation, given precomputed star-
26762      *  independent astrometry parameters, and assuming zero parallax and
26763      *  proper motion.
26764      *
26765      *  Use of this function is appropriate when efficiency is important and
26766      *  where many star positions are to be transformed for one date.  The
26767      *  star-independent parameters can be obtained by calling one of the
26768      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26769      *
26770      *  The corresponding function for the case of non-zero parallax and
26771      *  proper motion is iauAtciq.
26772      *
26773      *<p>This function is derived from the International Astronomical Union's
26774      *  SOFA (Standards of Fundamental Astronomy) software collection.
26775      *
26776      *<p>Status:  support function.
26777      *
26778      *<!-- Given: -->
26779      *     @param rc double      ICRS astrometric RA,Dec (radians)
26780      *     @param dc double      ICRS astrometric RA,Dec (radians) 
26781      *     @param astrom    star-independent astrometry parameters:
26782      *
26783      *<!-- Returned:-->
26784      *     @return ri,di   double       <b>Returned</b> CIRS RA,Dec (radians)
26785      *
26786      *  Note:
26787      *
26788      *     @return All  the   <b>Returned</b> vectors are with respect to BCRS axes.
26789      *
26790      *<p>References:
26791      * <ul>
26792      *
26793      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
26794      *     the Astronomical Almanac, 3rd ed., University Science Books
26795      *     (2013).
26796      *
26797      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
26798      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
26799      *
26800      * </ul>
26801      *  Called:
26802      * <ul>
26803      *     <li>{@link #jauS2c} spherical coordinates to unit vector
26804      *     <li>{@link #jauLdsun} light deflection due to Sun
26805      *     <li>{@link #jauAb} stellar aberration
26806      *     <li>{@link #jauRxp} product of r-matrix and p-vector
26807      *     <li>{@link #jauC2s} p-vector to spherical
26808      *     <li>{@link #jauAnp} normalize angle into range +/- pi
26809      *
26810      * </ul>
26811      *@version  2013 October 9
26812      *
26813      *@since JSOFA release 20131202
26814      *
26815      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26816      */
26817     public static SphericalCoordinate jauAtciqz(double rc, double dc, Astrom astrom)
26818     {
26819         double pco[], pnat[], ppr[] = new double[3], pi[];
26820 
26821 
26822         /* BCRS coordinate direction (unit vector). */
26823         pco = jauS2c(rc, dc);
26824 
26825         /* Light deflection by the Sun, giving BCRS natural direction. */
26826         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26827 
26828         /* Aberration, giving GCRS proper direction. */
26829         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26830 
26831         /* Bias-precession-nutation, giving CIRS proper direction. */
26832         pi = jauRxp(astrom.bpn, ppr);
26833 
26834         /* CIRS RA,Dec. */
26835         SphericalCoordinate co = jauC2s(pi);
26836         co.alpha = jauAnp(co.alpha);
26837 
26838         return co;
26839         /* Finished. */
26840 
26841 
26842     }
26843 
26844     /**
26845      *  ICRS RA,Dec to observed place.  The caller supplies UTC, site
26846      *  coordinates, ambient air conditions and observing wavelength.
26847      *
26848      *  SOFA models are used for the Earth ephemeris, bias-precession-
26849      *  nutation, Earth orientation and refraction.
26850      *
26851      *<p>This function is derived from the International Astronomical Union's
26852      *  SOFA (Standards of Fundamental Astronomy) software collection.
26853      *
26854      *<p>Status:  support function.
26855      *
26856      *<!-- Given: -->
26857      *     @param rc double    ICRS right ascension at J2000.0 (radians, Note 1)
26858      *     @param dc double    ICRS right ascension at J2000.0 (radians, Note 1) 
26859      *     @param pr      double    RA proper motion (radians/year; Note 2)
26860      *     @param pd      double    Dec proper motion (radians/year)
26861      *     @param px      double    parallax (arcsec)
26862      *     @param rv      double    radial velocity (km/s, +ve if receding)
26863      *     @param utc1    double    UTC as a 2-part...
26864      *     @param utc2    double    ...quasi Julian Date (Notes 3-4)
26865      *     @param dut1    double    UT1-UTC (seconds, Note 5)
26866      *     @param elong   double    longitude (radians, east +ve, Note 6)
26867      *     @param phi     double    latitude (geodetic, radians, Note 6)
26868      *     @param hm      double    height above ellipsoid (m, geodetic, Notes 6,8)
26869      *     @param xp double    polar motion coordinates (radians, Note 7)
26870      *     @param yp double    polar motion coordinates (radians, Note 7) 
26871      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
26872      *     @param tc      double    ambient temperature at the observer (deg C)
26873      *     @param rh      double    relative humidity at the observer (range 0-1)
26874      *     @param wl      double    wavelength (micrometers, Note 9)
26875      *
26876      *<!-- Returned:-->
26877      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
26878      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
26879      *             hob     double*    <b>Returned</b> observed hour angle (radians)
26880      *             dob     double*    <b>Returned</b> observed declination (radians)
26881      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
26882      *             eo      double*    <b>Returned</b> equation of the origins (ERA-GST)
26883      *
26884      *  @throws JSOFAInternalError an internal error has occured
26885      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 4)
26886      *                               0  =   <b>Returned</b> OK
26887      *                              -1  =   <b>Returned</b> unacceptable date
26888      *
26889      *<p>Notes:
26890      * <ol>
26891      *
26892      *  <li> Star data for an epoch other than J2000.0 (for example from the
26893      *      Hipparcos catalog, which has an epoch of J1991.25) will require
26894      *      a preliminary call to iauPmsafe before use.
26895      *
26896      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26897      *
26898      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
26899      *      convenient way between the two arguments, for example where utc1
26900      *      is the Julian Day Number and utc2 is the fraction of a day.
26901      *
26902      *      <p>However, JD cannot unambiguously represent UTC during a leap
26903      *      second unless special measures are taken.  The convention in the
26904      *      present function is that the JD day represents UTC days whether
26905      *      the length is 86399, 86400 or 86401 SI seconds.
26906      *
26907      *      <p>Applications should use the function iauDtf2d to convert from
26908      *      calendar date and time of day into 2-part quasi Julian Date, as
26909      *      it implements the leap-second-ambiguity convention just
26910      *      described.
26911      *
26912      *  <li> The warning status "dubious year" flags UTCs that predate the
26913      *      introduction of the time scale or that are too far in the
26914      *      future to be trusted.  See iauDat for further details.
26915      *
26916      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
26917      *      one second at the end of each positive UTC leap second,
26918      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
26919      *      practice is under review, and in the future UT1-UTC may grow
26920      *      essentially without limit.
26921      *
26922      *  <li> The geographical coordinates are with respect to the WGS84
26923      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26924      *      longitude required by the present function is east-positive
26925      *      (i.e. right-handed), in accordance with geographical convention.
26926      *
26927      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26928      *      values are the coordinates (in radians) of the Celestial
26929      *      Intermediate Pole with respect to the International Terrestrial
26930      *      Reference System (see IERS Conventions 2003), measured along the
26931      *      meridians 0 and 90 deg west respectively.  For many
26932      *      applications, xp and yp can be set to zero.
26933      *
26934      *  <li> If hm, the height above the ellipsoid of the observing station
26935      *      in meters, is not known but phpa, the pressure in hPa (=mB),
26936      *      is available, an adequate estimate of hm can be obtained from
26937      *      the expression
26938      *
26939      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
26940      *
26941      *      <p>where tsl is the approximate sea-level air temperature in K
26942      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
26943      *      52).  Similarly, if the pressure phpa is not known, it can be
26944      *      estimated from the height of the observing station, hm, as
26945      *      follows:
26946      *
26947      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
26948      *
26949      *      <p>Note, however, that the refraction is nearly proportional to
26950      *      the pressure and that an accurate phpa value is important for
26951      *      precise work.
26952      *
26953      *  <li> The argument wl specifies the observing wavelength in
26954      *      micrometers.  The transition from optical to radio is assumed to
26955      *      occur at 100 micrometers (about 3000 GHz).
26956      *
26957      *  <li> The accuracy of the result is limited by the corrections for
26958      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
26959      *      Providing the meteorological parameters are known accurately and
26960      *      there are no gross local effects, the predicted observed
26961      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
26962      *      (radio) for a zenith distance of less than 70 degrees, better
26963      *      than 30 arcsec (optical or radio) at 85 degrees and better
26964      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
26965      *
26966      *      <p>Without refraction, the complementary functions iauAtco13 and
26967      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
26968      *      all over the celestial sphere.  With refraction included,
26969      *      consistency falls off at high zenith distances, but is still
26970      *      better than 0.05 arcsec at 85 degrees.
26971      *
26972      *  <li> "Observed" Az,ZD means the position that would be seen by a
26973      *      perfect geodetically aligned theodolite.  (Zenith distance is
26974      *      used rather than altitude in order to reflect the fact that no
26975      *      allowance is made for depression of the horizon.)  This is
26976      *      related to the observed HA,Dec via the standard rotation, using
26977      *      the geodetic latitude (corrected for polar motion), while the
26978      *      observed HA and RA are related simply through the Earth rotation
26979      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
26980      *      means the position that would be seen by a perfect equatorial
26981      *      with its polar axis aligned to the Earth's axis of rotation.
26982      *
26983      *  <li> It is advisable to take great care with units, as even unlikely
26984      *      values of the input parameters are accepted and processed in
26985      *      accordance with the models used.
26986      *
26987      * </ol>
26988      *  Called:
26989      * <ul>
26990      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed, 2013
26991      *     <li>{@link #jauAtciq} quick ICRS to CIRS
26992      *     <li>{@link #jauAtioq} quick ICRS to observed
26993      *
26994      * </ul>
26995      *@version  2013 October 9
26996      *
26997      *@since JSOFA release 20131202
26998      *
26999      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27000      * @throws JSOFAInternalError an internal error has occured
27001      * @throws JSOFAIllegalParameter 
27002      */
27003     public static ObservedPositionEO jauAtco13(double rc, double dc,
27004             double pr, double pd, double px, double rv,
27005             double utc1, double utc2, double dut1,
27006             double elong, double phi, double hm, double xp, double yp,
27007             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27008     {
27009         Astrom astrom = new Astrom();
27010 
27011 
27012         /* Star-independent astrometry parameters. */
27013         double eo = jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27014                 phpa, tc, rh, wl, astrom);
27015 
27016         /* Transform ICRS to CIRS. */
27017         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
27018 
27019         /* Transform CIRS to observed. */
27020         ObservedPosition obs = jauAtioq(co.alpha, co.delta, astrom);
27021 
27022       
27023         return new ObservedPositionEO(obs, eo);
27024         
27025         /* Finished. */
27026 
27027 
27028     }
27029 
27030     /**
27031      *  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
27032      *
27033      *<p>This function is derived from the International Astronomical Union's
27034      *  SOFA (Standards of Fundamental Astronomy) software collection.
27035      *
27036      *<p>Status:  support function.
27037      *
27038      *<!-- Given: -->
27039      *     @param ri double   CIRS geocentric RA,Dec (radians)
27040      *     @param di double   CIRS geocentric RA,Dec (radians) 
27041      *     @param date1   double   TDB as a 2-part...
27042      *     @param date2   double   ...Julian Date (Note 1)
27043      *
27044      *<!-- Returned:-->
27045      *     @return rc,dc   double    <b>Returned</b> ICRS astrometric RA,Dec (radians)
27046      *      eo      double    <b>Returned</b> equation of the origins (ERA-GST, Note 4)
27047      *
27048      *<p>Notes:
27049      * <ol>
27050      *
27051      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
27052      *     convenient way between the two arguments.  For example,
27053      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
27054      *     others:
27055      *
27056      *            date1          date2
27057      *
27058      *         2450123.7           0.0       (JD method)
27059      *         2451545.0       -1421.3       (J2000 method)
27060      *         2400000.5       50123.2       (MJD method)
27061      *         2450123.5           0.2       (date &amp; time method)
27062      *
27063      *     <p>The JD method is the most natural and convenient to use in cases
27064      *     where the loss of several decimal digits of resolution is
27065      *     acceptable.  The J2000 method is best matched to the way the
27066      *     argument is handled internally and will deliver the optimum
27067      *     resolution.  The MJD method and the date &amp; time methods are both
27068      *     good compromises between resolution and convenience.  For most
27069      *     applications of this function the choice will not be at all
27070      *     critical.
27071      *
27072      *     <p>TT can be used instead of TDB without any significant impact on
27073      *     accuracy.
27074      *
27075      *  <li> Iterative techniques are used for the aberration and light
27076      *     deflection corrections so that the functions iauAtic13 (or
27077      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27078      *     even at the edge of the Sun's disk the discrepancy is only about
27079      *     1 nanoarcsecond.
27080      *
27081      *  <li> The available accuracy is better than 1 milliarcsecond, limited
27082      *     mainly by the precession-nutation model that is used, namely
27083      *     IAU 2000A/2006.  Very close to solar system bodies, additional
27084      *     errors of up to several milliarcseconds can occur because of
27085      *     unmodeled light deflection;  however, the Sun's contribution is
27086      *     taken into account, to first order.  The accuracy limitations of
27087      *     the SOFA function iauEpv00 (used to compute Earth position and
27088      *     velocity) can contribute aberration errors of up to
27089      *     5 microarcseconds.  Light deflection at the Sun's limb is
27090      *     uncertain at the 0.4 mas level.
27091      *
27092      *  <li> Should the transformation to (equinox based) J2000.0 mean place
27093      *     be required rather than (CIO based) ICRS coordinates, subtract the
27094      *     equation of the origins from the returned right ascension:
27095      *     RA = RI - EO.  (The iauAnp function can then be applied, as
27096      *     required, to keep the result in the conventional 0-2pi range.)
27097      *
27098      * </ol>
27099      *  Called:
27100      * <ul>
27101      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
27102      *     <li>{@link #jauAticq} quick CIRS to ICRS astrometric
27103      *
27104      * </ul>
27105      *@version  2013 October 9
27106      *
27107      *@since JSOFA release 20131202
27108      *
27109      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27110      */
27111     public static SphericalCoordinateEO jauAtic13(double ri, double di, double date1, double date2)
27112     {
27113         /* Star-independent astrometry parameters */
27114         Astrom astrom = new Astrom();
27115 
27116 
27117         /* Star-independent astrometry parameters. */
27118         double eo = jauApci13(date1, date2, astrom);
27119 
27120         /* CIRS to ICRS astrometric. */
27121         SphericalCoordinate co = jauAticq(ri, di, astrom);
27122 
27123         return new SphericalCoordinateEO(co,eo);
27124         /* Finished. */
27125 
27126 
27127     }
27128 
27129     /**
27130      *  Quick CIRS RA,Dec to ICRS astrometric place, given the star-
27131      *  independent astrometry parameters.
27132      *
27133      *  Use of this function is appropriate when efficiency is important and
27134      *  where many star positions are all to be transformed for one date.
27135      *  The star-independent astrometry parameters can be obtained by
27136      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27137      *  or iauApcs[13].
27138      *
27139      *<p>This function is derived from the International Astronomical Union's
27140      *  SOFA (Standards of Fundamental Astronomy) software collection.
27141      *
27142      *<p>Status:  support function.
27143      *
27144      *<!-- Given: -->
27145      *     @param ri double      CIRS RA,Dec (radians)
27146      *     @param di double      CIRS RA,Dec (radians) 
27147      *     @param astrom    star-independent astrometry parameters:
27148      *
27149      *<!-- Returned:-->
27150      *     @return rc,dc   double       <b>Returned</b> ICRS astrometric RA,Dec (radians)
27151      *
27152      *<p>Notes:
27153      * <ol>
27154      *
27155      *  <li> Only the Sun is taken into account in the light deflection
27156      *     correction.
27157      *
27158      *  <li> Iterative techniques are used for the aberration and light
27159      *     deflection corrections so that the functions iauAtic13 (or
27160      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27161      *     even at the edge of the Sun's disk the discrepancy is only about
27162      *     1 nanoarcsecond.
27163      *
27164      * </ol>
27165      *  Called:
27166      * <ul>
27167      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27168      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27169      *     <li>{@link #jauZp} zero p-vector
27170      *     <li>{@link #jauAb} stellar aberration
27171      *     <li>{@link #jauLdsun} light deflection by the Sun
27172      *     <li>{@link #jauC2s} p-vector to spherical
27173      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27174      *
27175      * </ul>
27176      *@version  2013 October 9
27177      *
27178      *@since JSOFA release 20131202
27179      *
27180      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27181      */
27182     public static SphericalCoordinate  jauAticq(double ri, double di, Astrom astrom )
27183     {
27184         int j, i;
27185         double pi[] , ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], 
27186                 before[] = new double[3], r2, r,
27187                 after[];
27188 
27189 
27190         /* CIRS RA,Dec to Cartesian. */
27191         pi = jauS2c(ri, di);
27192 
27193         /* Bias-precession-nutation, giving GCRS proper direction. */
27194         ppr = jauTrxp(astrom.bpn, pi);
27195 
27196         /* Aberration, giving GCRS natural direction. */
27197         jauZp(d);
27198         for (j = 0; j < 2; j++) {
27199             r2 = 0.0;
27200             for (i = 0; i < 3; i++) {
27201                 w = ppr[i] - d[i];
27202                 before[i] = w;
27203                 r2 += w*w;
27204             }
27205             r = sqrt(r2);
27206             for (i = 0; i < 3; i++) {
27207                 before[i] /= r;
27208             }
27209             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27210             r2 = 0.0;
27211             for (i = 0; i < 3; i++) {
27212                 d[i] = after[i] - before[i];
27213                 w = ppr[i] - d[i];
27214                 pnat[i] = w;
27215                 r2 += w*w;
27216             }
27217             r = sqrt(r2);
27218             for (i = 0; i < 3; i++) {
27219                 pnat[i] /= r;
27220             }
27221         }
27222 
27223         /* Light deflection by the Sun, giving BCRS coordinate direction. */
27224         jauZp(d);
27225         for (j = 0; j < 5; j++) {
27226             r2 = 0.0;
27227             for (i = 0; i < 3; i++) {
27228                 w = pnat[i] - d[i];
27229                 before[i] = w;
27230                 r2 += w*w;
27231             }
27232             r = sqrt(r2);
27233             for (i = 0; i < 3; i++) {
27234                 before[i] /= r;
27235             }
27236             after = jauLdsun(before, astrom.eh, astrom.em);
27237             r2 = 0.0;
27238             for (i = 0; i < 3; i++) {
27239                 d[i] = after[i] - before[i];
27240                 w = pnat[i] - d[i];
27241                 pco[i] = w;
27242                 r2 += w*w;
27243             }
27244             r = sqrt(r2);
27245             for (i = 0; i < 3; i++) {
27246                 pco[i] /= r;
27247             }
27248         }
27249 
27250         /* ICRS astrometric RA,Dec. */
27251         SphericalCoordinate co = jauC2s(pco);
27252         co.alpha = jauAnp(co.alpha);
27253 
27254         return co;
27255         /* Finished. */
27256 
27257 
27258     }
27259 
27260     /**
27261      *  Quick CIRS to ICRS astrometric place transformation, given the star-
27262      *  independent astrometry parameters plus a list of light-deflecting
27263      *  bodies.
27264      *
27265      *  Use of this function is appropriate when efficiency is important and
27266      *  where many star positions are all to be transformed for one date.
27267      *  The star-independent astrometry parameters can be obtained by
27268      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27269      *  or iauApcs[13].
27270      *
27271      *  If the only light-deflecting body to be taken into account is the
27272      *  Sun, the iauAticq function can be used instead.
27273      *
27274      *<p>This function is derived from the International Astronomical Union's
27275      *  SOFA (Standards of Fundamental Astronomy) software collection.
27276      *
27277      *<p>Status:  support function.
27278      *
27279      *<!-- Given: -->
27280      *     @param ri double       CIRS RA,Dec (radians)
27281      *     @param di double       CIRS RA,Dec (radians) 
27282      *     @param astrom     star-independent astrometry parameters:
27283      *     @param n number of bodies.
27284      *     @param b[] data for each of the n bodies.
27285      *
27286      *<!-- Returned:-->
27287      *     @return        ICRS astrometric RA,Dec (radians)
27288      *
27289      *<p>Notes:
27290      * <ol>
27291      *
27292      *  <li> Iterative techniques are used for the aberration and light
27293      *     deflection corrections so that the functions iauAticqn and
27294      *     iauAtciqn are accurate inverses; even at the edge of the Sun's
27295      *     disk the discrepancy is only about 1 nanoarcsecond.
27296      *
27297      *  <li> If the only light-deflecting body to be taken into account is the
27298      *     Sun, the iauAticq function can be used instead.
27299      *
27300      *  <li> The struct b contains n entries, one for each body to be
27301      *     considered.  If n = 0, no gravitational light deflection will be
27302      *     applied, not even for the Sun.
27303      *
27304      *  <li> The struct b should include an entry for the Sun as well as for
27305      *     any planet or other body to be taken into account.  The entries
27306      *     should be in the order in which the light passes the body.
27307      *
27308      *  <li> In the entry in the b struct for body i, the mass parameter
27309      *     b[i].bm can, as required, be adjusted in order to allow for such
27310      *     effects as quadrupole field.
27311      *
27312      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
27313      *     the angular separation (in radians) between star and body at
27314      *     which limiting is applied.  As phi shrinks below the chosen
27315      *     threshold, the deflection is artificially reduced, reaching zero
27316      *     for phi = 0.   Example values suitable for a terrestrial
27317      *     observer, together with masses, are as follows:
27318      *
27319      *        <p>body i     b[i].bm        b[i].dl
27320      *
27321      *        <p>Sun        1.0            6e-6
27322      *        Jupiter    0.00095435     3e-9
27323      *        Saturn     0.00028574     3e-10
27324      *
27325      *  <li> For efficiency, validation of the contents of the b array is
27326      *     omitted.  The supplied masses must be greater than zero, the
27327      *     position and velocity vectors must be right, and the deflection
27328      *     limiter greater than zero.
27329      *
27330      * </ol>
27331      *  Called:
27332      * <ul>
27333      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27334      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27335      *     <li>{@link #jauZp} zero p-vector
27336      *     <li>{@link #jauAb} stellar aberration
27337      *     <li>{@link #jauLdn} light deflection by n bodies
27338      *     <li>{@link #jauC2s} p-vector to spherical
27339      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27340      *
27341      * </ul>
27342      *@version  2013 October 9
27343      *
27344      *@since JSOFA release 20131202
27345      *
27346      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27347      */
27348     public static SphericalCoordinate jauAticqn(double ri, double di, Astrom astrom,
27349             int n, Ldbody b[])
27350     {
27351         int j, i;
27352         double pi[], ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], before[] = new double[3], r2, r,
27353                 after[];
27354 
27355 
27356         /* CIRS RA,Dec to Cartesian. */
27357         pi = jauS2c(ri, di);
27358 
27359         /* Bias-precession-nutation, giving GCRS proper direction. */
27360         ppr = jauTrxp(astrom.bpn, pi);
27361 
27362         /* Aberration, giving GCRS natural direction. */
27363         jauZp(d);
27364         for (j = 0; j < 2; j++) {
27365             r2 = 0.0;
27366             for (i = 0; i < 3; i++) {
27367                 w = ppr[i] - d[i];
27368                 before[i] = w;
27369                 r2 += w*w;
27370             }
27371             r = sqrt(r2);
27372             for (i = 0; i < 3; i++) {
27373                 before[i] /= r;
27374             }
27375             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27376             r2 = 0.0;
27377             for (i = 0; i < 3; i++) {
27378                 d[i] = after[i] - before[i];
27379                 w = ppr[i] - d[i];
27380                 pnat[i] = w;
27381                 r2 += w*w;
27382             }
27383             r = sqrt(r2);
27384             for (i = 0; i < 3; i++) {
27385                 pnat[i] /= r;
27386             }
27387         }
27388 
27389         /* Light deflection, giving BCRS coordinate direction. */
27390         jauZp(d);
27391         for (j = 0; j < 5; j++) {
27392             r2 = 0.0;
27393             for (i = 0; i < 3; i++) {
27394                 w = pnat[i] - d[i];
27395                 before[i] = w;
27396                 r2 += w*w;
27397             }
27398             r = sqrt(r2);
27399             for (i = 0; i < 3; i++) {
27400                 before[i] /= r;
27401             }
27402             after = jauLdn(n, b, astrom.eb, before);
27403             r2 = 0.0;
27404             for (i = 0; i < 3; i++) {
27405                 d[i] = after[i] - before[i];
27406                 w = pnat[i] - d[i];
27407                 pco[i] = w;
27408                 r2 += w*w;
27409             }
27410             r = sqrt(r2);
27411             for (i = 0; i < 3; i++) {
27412                 pco[i] /= r;
27413             }
27414         }
27415 
27416         /* ICRS astrometric RA,Dec. */
27417         SphericalCoordinate co = jauC2s(pco);
27418         co.alpha = jauAnp(co.alpha);
27419 
27420         return co;
27421         /* Finished. */
27422 
27423 
27424     }
27425     
27426     /**
27427      * Observed Position.
27428      *  "Observed" Az,ZD means the position that would be seen by a
27429      *      perfect geodetically aligned theodolite.  (Zenith distance is
27430      *      used rather than altitude in order to reflect the fact that no
27431      *      allowance is made for depression of the horizon.)  This is
27432      *      related to the observed HA,Dec via the standard rotation, using
27433      *      the geodetic latitude (corrected for polar motion), while the
27434      *      observed HA and RA are related simply through the Earth rotation
27435      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27436      *      means the position that would be seen by a perfect equatorial
27437      *      with its polar axis aligned to the Earth's axis of rotation..
27438      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
27439      * @version $Revision$ $date$
27440      */
27441     public static class ObservedPosition{
27442         /**    observed azimuth (radians: N=0,E=90) */
27443         public double   aob;
27444 
27445         /**    observed zenith distance (radians)   */
27446         public double   zob;
27447 
27448         /**    observed Hour Angle (radians)        */
27449         public double   hob;
27450 
27451         /**    observed Declination (radians)       */
27452         public double   dob;
27453 
27454         /**    observed Right Ascension (radians)   */
27455         public double   rob;
27456         public ObservedPosition(double   aob,
27457                 double   zob,
27458                 double   hob,
27459                 double   dob,
27460                 double   rob
27461         ) {
27462             this.aob =  aob;
27463             this.zob =  zob;
27464             this.hob =  hob;
27465             this.dob =  dob;
27466             this.rob =  rob;  
27467         }
27468     }
27469     
27470     /**
27471      * Observed position with the equation of the origins.
27472      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Mar 2014
27473      * @version $Revision$ $date$
27474      */
27475     public static class ObservedPositionEO {
27476        /**
27477         * observed position.
27478         */
27479         public ObservedPosition op;
27480         /**
27481          * The equation of the origins.    The equation of the origins is the distance between the true
27482          *  equinox and the celestial intermediate origin and, equivalently,
27483          *  the difference between Earth rotation angle and Greenwich
27484          *  apparent sidereal time (ERA-GST).  It comprises the precession
27485          *  (since J2000.0) in right ascension plus the equation of the
27486          *  equinoxes (including the small correction terms).   
27487          */
27488         public double eo;
27489         /**
27490          * @param op
27491          * @param eo
27492          */
27493         public ObservedPositionEO(ObservedPosition op, double eo) {
27494             this.op = op;
27495             this.eo = eo;
27496         }
27497         
27498     }
27499 
27500     
27501     
27502     
27503     /**
27504      *  CIRS RA,Dec to observed place.  The caller supplies UTC, site
27505      *  coordinates, ambient air conditions and observing wavelength.
27506      *
27507      *<p>This function is derived from the International Astronomical Union's
27508      *  SOFA (Standards of Fundamental Astronomy) software collection.
27509      *
27510      *<p>Status:  support function.
27511      *
27512      *<!-- Given: -->
27513      *     @param ri      double    CIRS right ascension (CIO-based, radians)
27514      *     @param di      double    CIRS declination (radians)
27515      *     @param utc1    double    UTC as a 2-part...
27516      *     @param utc2    double    ...quasi Julian Date (Notes 1,2)
27517      *     @param dut1    double    UT1-UTC (seconds, Note 3)
27518      *     @param elong   double    longitude (radians, east +ve, Note 4)
27519      *     @param phi     double    geodetic latitude (radians, Note 4)
27520      *     @param hm      double    height above ellipsoid (m, geodetic Notes 4,6)
27521      *     @param xp double    polar motion coordinates (radians, Note 5)
27522      *     @param yp double    polar motion coordinates (radians, Note 5) 
27523      *     @param phpa    double    pressure at the observer (hPa = mB, Note 6)
27524      *     @param tc      double    ambient temperature at the observer (deg C)
27525      *     @param rh      double    relative humidity at the observer (range 0-1)
27526      *     @param wl      double    wavelength (micrometers, Note 7)
27527      *
27528      *<!-- Returned:-->
27529      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
27530      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
27531      *             hob     double*    <b>Returned</b> observed hour angle (radians)
27532      *             dob     double*    <b>Returned</b> observed declination (radians)
27533      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
27534      *
27535      *  @throws JSOFAInternalError an internal error has occured
27536      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 2)
27537      *                              0  =   <b>Returned</b> OK
27538      *                              -1  =   <b>Returned</b> unacceptable date
27539      *
27540      *<p>Notes:
27541      * <ol>
27542      *
27543      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27544      *      convenient way between the two arguments, for example where utc1
27545      *      is the Julian Day Number and utc2 is the fraction of a day.
27546      *
27547      *      <p>However, JD cannot unambiguously represent UTC during a leap
27548      *      second unless special measures are taken.  The convention in the
27549      *      present function is that the JD day represents UTC days whether
27550      *      the length is 86399, 86400 or 86401 SI seconds.
27551      *
27552      *      <p>Applications should use the function iauDtf2d to convert from
27553      *      calendar date and time of day into 2-part quasi Julian Date, as
27554      *      it implements the leap-second-ambiguity convention just
27555      *      described.
27556      *
27557      *  <li> The warning status "dubious year" flags UTCs that predate the
27558      *      introduction of the time scale or that are too far in the
27559      *      future to be trusted.  See iauDat for further details.
27560      *
27561      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27562      *      one second at the end of each positive UTC leap second,
27563      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27564      *      practice is under review, and in the future UT1-UTC may grow
27565      *      essentially without limit.
27566      *
27567      *  <li> The geographical coordinates are with respect to the WGS84
27568      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27569      *      longitude required by the present function is east-positive
27570      *      (i.e. right-handed), in accordance with geographical convention.
27571      *
27572      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27573      *      values are the coordinates (in radians) of the Celestial
27574      *      Intermediate Pole with respect to the International Terrestrial
27575      *      Reference System (see IERS Conventions 2003), measured along the
27576      *      meridians 0 and 90 deg west respectively.  For many
27577      *      applications, xp and yp can be set to zero.
27578      *
27579      *  <li> If hm, the height above the ellipsoid of the observing station
27580      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
27581      *      available, an adequate estimate of hm can be obtained from the
27582      *      expression
27583      *
27584      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27585      *
27586      *      <p>where tsl is the approximate sea-level air temperature in K
27587      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27588      *      52).  Similarly, if the pressure phpa is not known, it can be
27589      *      estimated from the height of the observing station, hm, as
27590      *      follows:
27591      *
27592      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27593      *
27594      *      <p>Note, however, that the refraction is nearly proportional to
27595      *      the pressure and that an accurate phpa value is important for
27596      *      precise work.
27597      *
27598      *  <li> The argument wl specifies the observing wavelength in
27599      *      micrometers.  The transition from optical to radio is assumed to
27600      *      occur at 100 micrometers (about 3000 GHz).
27601      *
27602      *  <li> "Observed" Az,ZD means the position that would be seen by a
27603      *      perfect geodetically aligned theodolite.  (Zenith distance is
27604      *      used rather than altitude in order to reflect the fact that no
27605      *      allowance is made for depression of the horizon.)  This is
27606      *      related to the observed HA,Dec via the standard rotation, using
27607      *      the geodetic latitude (corrected for polar motion), while the
27608      *      observed HA and RA are related simply through the Earth rotation
27609      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27610      *      means the position that would be seen by a perfect equatorial
27611      *      with its polar axis aligned to the Earth's axis of rotation.
27612      *
27613      *  <li> The accuracy of the result is limited by the corrections for
27614      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27615      *      Providing the meteorological parameters are known accurately and
27616      *      there are no gross local effects, the predicted astrometric
27617      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27618      *      (radio) for a zenith distance of less than 70 degrees, better
27619      *      than 30 arcsec (optical or radio) at 85 degrees and better
27620      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27621      *
27622      *  <li> The complementary functions iauAtio13 and iauAtoi13 are self-
27623      *      consistent to better than 1 microarcsecond all over the
27624      *      celestial sphere.
27625      *
27626      *  <li> It is advisable to take great care with units, as even unlikely
27627      *      values of the input parameters are accepted and processed in
27628      *      accordance with the models used.
27629      *
27630      * </ol>
27631      *  Called:
27632      * <ul>
27633      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
27634      *     <li>{@link #jauAtioq} quick CIRS to observed
27635      *
27636      * </ul>
27637      *@version  2013 October 9
27638      *
27639      *@since JSOFA release 20131202
27640      *
27641      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27642      * @throws JSOFAInternalError an internal error has occured
27643      * @throws JSOFAIllegalParameter 
27644      */
27645     public static ObservedPosition jauAtio13(double ri, double di,
27646             double utc1, double utc2, double dut1,
27647             double elong, double phi, double hm, double xp, double yp,
27648             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27649     {
27650         Astrom astrom = new Astrom();
27651 
27652 
27653         /* Star-independent astrometry parameters for CIRS->observed. */
27654         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27655                 phpa, tc, rh, wl, astrom);
27656 
27657         /* Transform CIRS to observed. */
27658         return jauAtioq(ri, di, astrom);
27659 
27660         /* Finished. */
27661 
27662 
27663     }
27664 
27665     /**
27666      *  Quick CIRS to observed place transformation.
27667      *
27668      *  Use of this function is appropriate when efficiency is important and
27669      *  where many star positions are all to be transformed for one date.
27670      *  The star-independent astrometry parameters can be obtained by
27671      *  calling iauApio[13] or iauApco[13].
27672      *
27673      *<p>This function is derived from the International Astronomical Union's
27674      *  SOFA (Standards of Fundamental Astronomy) software collection.
27675      *
27676      *<p>Status:  support function.
27677      *
27678      *<!-- Given: -->
27679      *     @param ri      double      CIRS right ascension
27680      *     @param di      double      CIRS declination
27681      *     @param astrom    star-independent astrometry parameters:
27682      *
27683      *<!-- Returned:-->
27684      *     @return aob     double*      <b>Returned</b> observed azimuth (radians: N=0,E=90)
27685      *             zob     double*      <b>Returned</b> observed zenith distance (radians)
27686      *             hob     double*      <b>Returned</b> observed hour angle (radians)
27687      *             dob     double*      <b>Returned</b> observed declination (radians)
27688      *             rob     double*      <b>Returned</b> observed right ascension (CIO-based, radians)
27689      *
27690      *<p>Notes:
27691      * <ol>
27692      *
27693      *  <li> This function returns zenith distance rather than altitude in
27694      *     order to reflect the fact that no allowance is made for
27695      *     depression of the horizon.
27696      *
27697      *  <li> The accuracy of the result is limited by the corrections for
27698      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27699      *     Providing the meteorological parameters are known accurately and
27700      *     there are no gross local effects, the predicted observed
27701      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27702      *     (radio) for a zenith distance of less than 70 degrees, better
27703      *     than 30 arcsec (optical or radio) at 85 degrees and better
27704      *     than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27705      *
27706      *     <p>Without refraction, the complementary functions iauAtioq and
27707      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
27708      *     over the celestial sphere.  With refraction included, consistency
27709      *     falls off at high zenith distances, but is still better than
27710      *     0.05 arcsec at 85 degrees.
27711      *
27712      *  <li> It is advisable to take great care with units, as even unlikely
27713      *     values of the input parameters are accepted and processed in
27714      *     accordance with the models used.
27715      *
27716      *  <li> The CIRS RA,Dec is obtained from a star catalog mean place by
27717      *     allowing for space motion, parallax, the Sun's gravitational lens
27718      *     effect, annual aberration and precession-nutation.  For star
27719      *     positions in the ICRS, these effects can be applied by means of
27720      *     the iauAtci13 (etc.) functions.  Starting from classical "mean
27721      *     place" systems, additional transformations will be needed first.
27722      *
27723      *  <li> "Observed" Az,El means the position that would be seen by a
27724      *     perfect geodetically aligned theodolite.  This is obtained from
27725      *     the CIRS RA,Dec by allowing for Earth orientation and diurnal
27726      *     aberration, rotating from equator to horizon coordinates, and
27727      *     then adjusting for refraction.  The HA,Dec is obtained by
27728      *     rotating back into equatorial coordinates, and is the position
27729      *     that would be seen by a perfect equatorial with its polar axis
27730      *     aligned to the Earth's axis of rotation.  Finally, the RA is
27731      *     obtained by subtracting the HA from the local ERA.
27732      *
27733      *  <li> The star-independent CIRS-to-observed-place parameters in ASTROM
27734      *     may be computed with iauApio[13] or iauApco[13].  If nothing has
27735      *     changed significantly except the time, iauAper[13] may be used to
27736      *     perform the requisite adjustment to the astrom structure.
27737      *
27738      * </ol>
27739      *  Called:
27740      * <ul>
27741      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27742      *     <li>{@link #jauC2s} p-vector to spherical
27743      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
27744      *
27745      * </ul>
27746      *@version  2013 December 5
27747      *
27748      *@since JSOFA release 20131202
27749      *
27750      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27751      */
27752     public static ObservedPosition jauAtioq(double ri, double di, Astrom astrom)
27753     {
27754         /* Minimum cos(alt) and sin(alt) for refraction purposes */
27755         final double CELMIN = 1e-6;
27756         final double SELMIN = 0.05;
27757 
27758         double v[] = new double[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt,
27759                 xaet, yaet, zaet, azobs, r, tz, w, del, cosdel,
27760                 xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
27761 
27762         /*--------------------------------------------------------------------*/
27763 
27764         /* CIRS RA,Dec to Cartesian -HA,Dec. */
27765         v = jauS2c(ri-astrom.eral, di);
27766         x = v[0];
27767         y = v[1];
27768         z = v[2];
27769 
27770         /* Polar motion. */
27771         xhd = x + astrom.xpl*z;
27772         yhd = y - astrom.ypl*z;
27773         zhd = z - astrom.xpl*x + astrom.ypl*y;
27774 
27775         /* Diurnal aberration. */
27776         f = ( 1.0 - astrom.diurab*yhd );
27777         xhdt = f * xhd;
27778         yhdt = f * ( yhd + astrom.diurab );
27779         zhdt = f * zhd;
27780 
27781         /* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
27782         xaet = astrom.sphi*xhdt - astrom.cphi*zhdt;
27783         yaet = yhdt;
27784         zaet = astrom.cphi*xhdt + astrom.sphi*zhdt;
27785 
27786         /* Azimuth (N=0,E=90). */
27787         azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
27788 
27789         /* ---------- */
27790         /* Refraction */
27791         /* ---------- */
27792 
27793         /* Cosine and sine of altitude, with precautions. */
27794         r = sqrt(xaet*xaet + yaet*yaet);
27795         r = r > CELMIN ? r : CELMIN;
27796         z = zaet > SELMIN ? zaet : SELMIN;
27797 
27798         /* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
27799         tz = r/z;
27800         w = astrom.refb*tz*tz;
27801         del = ( astrom.refa + w ) * tz /
27802                 ( 1.0 + ( astrom.refa + 3.0*w ) / ( z*z ) );
27803 
27804         /* Apply the change, giving observed vector. */
27805         cosdel = 1.0 - del*del/2.0;
27806         f = cosdel - del*z/r;
27807         xaeo = xaet*f;
27808         yaeo = yaet*f;
27809         zaeo = cosdel*zaet + del*r;
27810 
27811         /* Observed ZD. */
27812         zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
27813 
27814         /* Az/El vector to HA,Dec vector (both right-handed). */
27815         v[0] = astrom.sphi*xaeo + astrom.cphi*zaeo;
27816         v[1] = yaeo;
27817         v[2] = - astrom.cphi*xaeo + astrom.sphi*zaeo;
27818 
27819         /* To spherical -HA,Dec. */
27820         SphericalCoordinate co = jauC2s ( v);
27821         hmobs = co.alpha;
27822         dcobs = co.delta;
27823         /* Right ascension (with respect to CIO). */
27824         raobs = astrom.eral + hmobs;
27825 
27826         /* Return the results. */
27827         return new ObservedPosition(
27828         jauAnp(azobs),
27829         zdobs,
27830         -hmobs,
27831         dcobs,
27832         jauAnp(raobs));
27833 
27834         /* Finished. */
27835 
27836 
27837     }
27838 
27839     /**
27840      *  Observed place at a groundbased site to to ICRS astrometric RA,Dec.
27841      *  The caller supplies UTC, site coordinates, ambient air conditions
27842      *  and observing wavelength.
27843      *
27844      *<p>This function is derived from the International Astronomical Union's
27845      *  SOFA (Standards of Fundamental Astronomy) software collection.
27846      *
27847      *<p>Status:  support function.
27848      *
27849      *<!-- Given: -->
27850      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
27851      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
27852      *     @param ob2     double    observed ZD or Dec (radians)
27853      *     @param utc1    double    UTC as a 2-part...
27854      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
27855      *     @param dut1    double    UT1-UTC (seconds, Note 5)
27856      *     @param elong   double    longitude (radians, east +ve, Note 6)
27857      *     @param phi     double    geodetic latitude (radians, Note 6)
27858      *     @param hm      double    height above ellipsoid (m, geodetic Notes 6,8)
27859      *     @param xp double    polar motion coordinates (radians, Note 7)
27860      *     @param yp double    polar motion coordinates (radians, Note 7) 
27861      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
27862      *     @param tc      double    ambient temperature at the observer (deg C)
27863      *     @param rh      double    relative humidity at the observer (range 0-1)
27864      *     @param wl      double    wavelength (micrometers, Note 9)
27865      *
27866      *<!-- Returned:-->
27867      *     @return rc,dc   double     <b>Returned</b> ICRS astrometric RA,Dec (radians)
27868      *
27869      *  @throws JSOFAInternalError an internal error has occured
27870      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 4)
27871      *                               0  =   <b>Returned</b> OK
27872      *                              -1  =   <b>Returned</b> unacceptable date
27873      *
27874      *<p>Notes:
27875      * <ol>
27876      *
27877      *  <li> "Observed" Az,ZD means the position that would be seen by a
27878      *      perfect geodetically aligned theodolite.  (Zenith distance is
27879      *      used rather than altitude in order to reflect the fact that no
27880      *      allowance is made for depression of the horizon.)  This is
27881      *      related to the observed HA,Dec via the standard rotation, using
27882      *      the geodetic latitude (corrected for polar motion), while the
27883      *      observed HA and RA are related simply through the Earth rotation
27884      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27885      *      means the position that would be seen by a perfect equatorial
27886      *      with its polar axis aligned to the Earth's axis of rotation.
27887      *
27888      *  <li> Only the first character of the type argument is significant.
27889      *      "R" or "r" indicates that ob1 and ob2 are the observed right
27890      *      ascension and declination;  "H" or "h" indicates that they are
27891      *      hour angle (west +ve) and declination;  anything else ("A" or
27892      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
27893      *      (north zero, east 90 deg) and zenith distance.
27894      *
27895      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27896      *      convenient way between the two arguments, for example where utc1
27897      *      is the Julian Day Number and utc2 is the fraction of a day.
27898      *
27899      *      <p>However, JD cannot unambiguously represent UTC during a leap
27900      *      second unless special measures are taken.  The convention in the
27901      *      present function is that the JD day represents UTC days whether
27902      *      the length is 86399, 86400 or 86401 SI seconds.
27903      *
27904      *      <p>Applications should use the function iauDtf2d to convert from
27905      *      calendar date and time of day into 2-part quasi Julian Date, as
27906      *      it implements the leap-second-ambiguity convention just
27907      *      described.
27908      *
27909      *  <li> The warning status "dubious year" flags UTCs that predate the
27910      *      introduction of the time scale or that are too far in the
27911      *      future to be trusted.  See iauDat for further details.
27912      *
27913      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27914      *      one second at the end of each positive UTC leap second,
27915      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27916      *      practice is under review, and in the future UT1-UTC may grow
27917      *      essentially without limit.
27918      *
27919      *  <li> The geographical coordinates are with respect to the WGS84
27920      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27921      *      longitude required by the present function is east-positive
27922      *      (i.e. right-handed), in accordance with geographical convention.
27923      *
27924      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27925      *      values are the coordinates (in radians) of the Celestial
27926      *      Intermediate Pole with respect to the International Terrestrial
27927      *      Reference System (see IERS Conventions 2003), measured along the
27928      *      meridians 0 and 90 deg west respectively.  For many
27929      *      applications, xp and yp can be set to zero.
27930      *
27931      *  <li> If hm, the height above the ellipsoid of the observing station
27932      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
27933      *      available, an adequate estimate of hm can be obtained from the
27934      *      expression
27935      *
27936      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27937      *
27938      *      <p>where tsl is the approximate sea-level air temperature in K
27939      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27940      *      52).  Similarly, if the pressure phpa is not known, it can be
27941      *      estimated from the height of the observing station, hm, as
27942      *      follows:
27943      *
27944      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27945      *
27946      *      <p>Note, however, that the refraction is nearly proportional to
27947      *      the pressure and that an accurate phpa value is important for
27948      *      precise work.
27949      *
27950      *  <li> The argument wl specifies the observing wavelength in
27951      *      micrometers.  The transition from optical to radio is assumed to
27952      *      occur at 100 micrometers (about 3000 GHz).
27953      *
27954      *  <li> The accuracy of the result is limited by the corrections for
27955      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27956      *      Providing the meteorological parameters are known accurately and
27957      *      there are no gross local effects, the predicted astrometric
27958      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27959      *      (radio) for a zenith distance of less than 70 degrees, better
27960      *      than 30 arcsec (optical or radio) at 85 degrees and better
27961      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27962      *
27963      *      <p>Without refraction, the complementary functions iauAtco13 and
27964      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
27965      *      all over the celestial sphere.  With refraction included,
27966      *      consistency falls off at high zenith distances, but is still
27967      *      better than 0.05 arcsec at 85 degrees.
27968      *
27969      *  <li> It is advisable to take great care with units, as even unlikely
27970      *      values of the input parameters are accepted and processed in
27971      *      accordance with the models used.
27972      *
27973      * </ol>
27974      *  Called:
27975      * <ul>
27976      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed
27977      *     <li>{@link #jauAtoiq} quick observed to CIRS
27978      *     <li>{@link #jauAticq} quick CIRS to ICRS
27979      *
27980      * </ul>
27981      *@version  2013 October 9
27982      *
27983      *@since JSOFA release 20131202
27984      *
27985      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27986      * @throws JSOFAInternalError an internal error has occured
27987      * @throws JSOFAIllegalParameter 
27988      */
27989     public static SphericalCoordinate jauAtoc13(String type, double ob1, double ob2,
27990             double utc1, double utc2, double dut1,
27991             double elong, double phi, double hm, double xp, double yp,
27992             double phpa, double tc, double rh, double wl
27993             ) throws JSOFAIllegalParameter, JSOFAInternalError
27994     {
27995         Astrom astrom = new Astrom();
27996         jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27997                 phpa, tc, rh, wl, astrom);
27998 
27999         /* Transform observed to CIRS. */
28000         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28001 
28002         /* Transform CIRS to ICRS. */
28003         SphericalCoordinate icrs = jauAticq(co.alpha, co.delta, astrom);
28004         return icrs;
28005        
28006 
28007         /* Finished. */
28008 
28009 
28010     }
28011 
28012     /**
28013      *  Observed place to CIRS.  The caller supplies UTC, site coordinates,
28014      *  ambient air conditions and observing wavelength.
28015      *
28016      *<p>This function is derived from the International Astronomical Union's
28017      *  SOFA (Standards of Fundamental Astronomy) software collection.
28018      *
28019      *<p>Status:  support function.
28020      *
28021      *<!-- Given: -->
28022      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
28023      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
28024      *     @param ob2     double    observed ZD or Dec (radians)
28025      *     @param utc1    double    UTC as a 2-part...
28026      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
28027      *     @param dut1    double    UT1-UTC (seconds, Note 5)
28028      *     @param elong   double    longitude (radians, east +ve, Note 6)
28029      *     @param phi     double    geodetic latitude (radians, Note 6)
28030      *     @param hm      double    height above the ellipsoid (meters, Notes 6,8)
28031      *     @param xp double    polar motion coordinates (radians, Note 7)
28032      *     @param yp double    polar motion coordinates (radians, Note 7) 
28033      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
28034      *     @param tc      double    ambient temperature at the observer (deg C)
28035      *     @param rh      double    relative humidity at the observer (range 0-1)
28036      *     @param wl      double    wavelength (micrometers, Note 9)
28037      *
28038      *<!-- Returned:-->
28039      *     @return ri      double*    <b>Returned</b> CIRS right ascension (CIO-based, radians)
28040      *             di      double*    <b>Returned</b> CIRS declination (radians)
28041      *
28042      *  @throws JSOFAInternalError an internal error has occured
28043      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 2)
28044      *                               0  =   <b>Returned</b> OK
28045      *                              -1  =   <b>Returned</b> unacceptable date
28046      *
28047      *<p>Notes:
28048      * <ol>
28049      *
28050      *  <li> "Observed" Az,ZD means the position that would be seen by a
28051      *      perfect geodetically aligned theodolite.  (Zenith distance is
28052      *      used rather than altitude in order to reflect the fact that no
28053      *      allowance is made for depression of the horizon.)  This is
28054      *      related to the observed HA,Dec via the standard rotation, using
28055      *      the geodetic latitude (corrected for polar motion), while the
28056      *      observed HA and RA are related simply through the Earth rotation
28057      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
28058      *      means the position that would be seen by a perfect equatorial
28059      *      with its polar axis aligned to the Earth's axis of rotation.
28060      *
28061      *  <li> Only the first character of the type argument is significant.
28062      *      "R" or "r" indicates that ob1 and ob2 are the observed right
28063      *      ascension and declination;  "H" or "h" indicates that they are
28064      *      hour angle (west +ve) and declination;  anything else ("A" or
28065      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
28066      *      (north zero, east 90 deg) and zenith distance.
28067      *
28068      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
28069      *      convenient way between the two arguments, for example where utc1
28070      *      is the Julian Day Number and utc2 is the fraction of a day.
28071      *
28072      *      <p>However, JD cannot unambiguously represent UTC during a leap
28073      *      second unless special measures are taken.  The convention in the
28074      *      present function is that the JD day represents UTC days whether
28075      *      the length is 86399, 86400 or 86401 SI seconds.
28076      *
28077      *      <p>Applications should use the function iauDtf2d to convert from
28078      *      calendar date and time of day into 2-part quasi Julian Date, as
28079      *      it implements the leap-second-ambiguity convention just
28080      *      described.
28081      *
28082      *  <li> The warning status "dubious year" flags UTCs that predate the
28083      *      introduction of the time scale or that are too far in the
28084      *      future to be trusted.  See iauDat for further details.
28085      *
28086      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
28087      *      one second at the end of each positive UTC leap second,
28088      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
28089      *      practice is under review, and in the future UT1-UTC may grow
28090      *      essentially without limit.
28091      *
28092      *  <li> The geographical coordinates are with respect to the WGS84
28093      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
28094      *      longitude required by the present function is east-positive
28095      *      (i.e. right-handed), in accordance with geographical convention.
28096      *
28097      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
28098      *      values are the coordinates (in radians) of the Celestial
28099      *      Intermediate Pole with respect to the International Terrestrial
28100      *      Reference System (see IERS Conventions 2003), measured along the
28101      *      meridians 0 and 90 deg west respectively.  For many
28102      *      applications, xp and yp can be set to zero.
28103      *
28104      *  <li> If hm, the height above the ellipsoid of the observing station
28105      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
28106      *      available, an adequate estimate of hm can be obtained from the
28107      *      expression
28108      *
28109      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
28110      *
28111      *      <p>where tsl is the approximate sea-level air temperature in K
28112      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
28113      *      52).  Similarly, if the pressure phpa is not known, it can be
28114      *      estimated from the height of the observing station, hm, as
28115      *      follows:
28116      *
28117      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
28118      *
28119      *      <p>Note, however, that the refraction is nearly proportional to
28120      *      the pressure and that an accurate phpa value is important for
28121      *      precise work.
28122      *
28123      *  <li> The argument wl specifies the observing wavelength in
28124      *      micrometers.  The transition from optical to radio is assumed to
28125      *      occur at 100 micrometers (about 3000 GHz).
28126      *
28127      *  <li> The accuracy of the result is limited by the corrections for
28128      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28129      *      Providing the meteorological parameters are known accurately and
28130      *      there are no gross local effects, the predicted astrometric
28131      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28132      *      (radio) for a zenith distance of less than 70 degrees, better
28133      *      than 30 arcsec (optical or radio) at 85 degrees and better
28134      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28135      *
28136      *      <p>Without refraction, the complementary functions iauAtio13 and
28137      *      iauAtoi13 are self-consistent to better than 1 microarcsecond
28138      *      all over the celestial sphere.  With refraction included,
28139      *      consistency falls off at high zenith distances, but is still
28140      *      better than 0.05 arcsec at 85 degrees.
28141      *
28142      *  <li> It is advisable to take great care with units, as even unlikely
28143      *      values of the input parameters are accepted and processed in
28144      *      accordance with the models used.
28145      *
28146      * </ol>
28147      *  Called:
28148      * <ul>
28149      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
28150      *     <li>{@link #jauAtoiq} quick observed to CIRS
28151      *
28152      * </ul>
28153      *@version  2013 October 9
28154      *
28155      *@since JSOFA release 20131202
28156      *
28157      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28158      * @throws JSOFAInternalError an internal error has occured
28159      * @throws JSOFAIllegalParameter 
28160      */
28161     public static SphericalCoordinate jauAtoi13(String type, double ob1, double ob2,
28162             double utc1, double utc2, double dut1,
28163             double elong, double phi, double hm, double xp, double yp,
28164             double phpa, double tc, double rh, double wl
28165             ) throws JSOFAIllegalParameter, JSOFAInternalError
28166     {
28167         Astrom astrom = new Astrom();
28168 
28169 
28170         /* Star-independent astrometry parameters for CIRS->observed. */
28171         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28172                 phpa, tc, rh, wl, astrom);
28173 
28174         /* Transform observed to CIRS. */
28175         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28176         return co;
28177         
28178         /* Finished. */
28179 
28180 
28181     }
28182 
28183     /**
28184      *  Quick observed place to CIRS, given the star-independent astrometry
28185      *  parameters.
28186      * 
28187      *  Use of this function is appropriate when efficiency is important and
28188      *  where many star positions are all to be transformed for one date.
28189      *  The star-independent astrometry parameters can be obtained by
28190      *  calling iauApio[13] or iauApco[13].
28191      *
28192      *<p>Status:  support function.
28193      *
28194      *<!-- Given: -->
28195      *     @param type    char[]      type of coordinates: "R", "H" or "A" (Note 1)
28196      *     @param ob1     double      observed Az, HA or RA (radians; Az is N=0,E=90)
28197      *     @param ob2     double      observed ZD or Dec (radians)
28198      *     @param astrom    star-independent astrometry parameters:
28199      *
28200      *<!-- Returned:-->
28201      *     @return ri      double*      <b>Returned</b> CIRS right ascension (CIO-based, radians)
28202      *             di      double*      <b>Returned</b> CIRS declination (radians)
28203      *
28204      *<p>Notes:
28205      * <ol>
28206      *
28207      *  <li> "Observed" Az,El means the position that would be seen by a
28208      *     perfect geodetically aligned theodolite.  This is related to
28209      *     the observed HA,Dec via the standard rotation, using the geodetic
28210      *     latitude (corrected for polar motion), while the observed HA and
28211      *     RA are related simply through the Earth rotation angle and the
28212      *     site longitude.  "Observed" RA,Dec or HA,Dec thus means the
28213      *     position that would be seen by a perfect equatorial with its
28214      *     polar axis aligned to the Earth's axis of rotation.  By removing
28215      *     from the observed place the effects of atmospheric refraction and
28216      *     diurnal aberration, the CIRS RA,Dec is obtained.
28217      *
28218      *  <li> Only the first character of the type argument is significant.
28219      *     "R" or "r" indicates that ob1 and ob2 are the observed right
28220      *     ascension and declination;  "H" or "h" indicates that they are
28221      *     hour angle (west +ve) and declination;  anything else ("A" or
28222      *     "a" is recommended) indicates that ob1 and ob2 are azimuth (north
28223      *     zero, east 90 deg) and zenith distance.  (Zenith distance is used
28224      *     rather than altitude in order to reflect the fact that no
28225      *     allowance is made for depression of the horizon.)
28226      *
28227      *  <li> The accuracy of the result is limited by the corrections for
28228      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28229      *     Providing the meteorological parameters are known accurately and
28230      *     there are no gross local effects, the predicted observed
28231      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28232      *     (radio) for a zenith distance of less than 70 degrees, better
28233      *     than 30 arcsec (optical or radio) at 85 degrees and better than
28234      *     20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28235      *
28236      *     <p>Without refraction, the complementary functions iauAtioq and
28237      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
28238      *     over the celestial sphere.  With refraction included, consistency
28239      *     falls off at high zenith distances, but is still better than
28240      *     0.05 arcsec at 85 degrees.
28241      *
28242      *  <li> It is advisable to take great care with units, as even unlikely
28243      *     values of the input parameters are accepted and processed in
28244      *     accordance with the models used.
28245      *
28246      * </ol>
28247      *  Called:
28248      * <ul>
28249      *     <li>{@link #jauS2c} spherical coordinates to unit vector
28250      *     <li>{@link #jauC2s} p-vector to spherical
28251      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
28252      *
28253      * </ul>
28254      *@version  2013 October 9
28255      *
28256      *@since JSOFA release 20131202
28257      *
28258      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28259      */
28260     public static SphericalCoordinate jauAtoiq(String type,
28261             double ob1, double ob2, Astrom astrom
28262             )
28263     {
28264         char c;
28265         double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[] = new double[3],
28266         xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref,
28267         zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda,
28268         f, xhd, yhd, zhd, xpl, ypl, w;
28269 
28270 
28271         /* Coordinate type. */
28272         c = type.charAt(0);
28273 
28274         /* Coordinates. */
28275         c1 = ob1;
28276         c2 = ob2;
28277 
28278         /* Sin, cos of latitude. */
28279         sphi = astrom.sphi;
28280         cphi = astrom.cphi;
28281 
28282         /* Standardize coordinate type. */
28283         if ( c == 'r' || c == 'R' ) {
28284             c = 'R';
28285         } else if ( c == 'h' || c == 'H' ) {
28286             c = 'H';
28287         } else {
28288             c = 'A';
28289         }
28290 
28291         /* If Az,ZD, convert to Cartesian (S=0,E=90). */
28292         if ( c == 'A' ) {
28293             ce = sin(c2);
28294             xaeo = - cos(c1) * ce;
28295             yaeo = sin(c1) * ce;
28296             zaeo = cos(c2);
28297 
28298         } else {
28299 
28300             /* If RA,Dec, convert to HA,Dec. */
28301             if ( c == 'R' ) c1 = astrom.eral - c1;
28302 
28303             /* To Cartesian -HA,Dec. */
28304             v = jauS2c ( -c1, c2 );
28305             xmhdo = v[0];
28306             ymhdo = v[1];
28307             zmhdo = v[2];
28308 
28309             /* To Cartesian Az,El (S=0,E=90). */
28310             xaeo = sphi*xmhdo - cphi*zmhdo;
28311             yaeo = ymhdo;
28312             zaeo = cphi*xmhdo + sphi*zmhdo;
28313         }
28314 
28315         /* Azimuth (S=0,E=90). */
28316         az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0;
28317 
28318         /* Sine of observed ZD, and observed ZD. */
28319         sz = sqrt ( xaeo*xaeo + yaeo*yaeo );
28320         zdo = atan2 ( sz, zaeo );
28321 
28322         /*
28323          * Refraction
28324          * ----------
28325          */
28326 
28327         /* Fast algorithm using two constant model. */
28328         refa = astrom.refa;
28329         refb = astrom.refb;
28330         tz = sz / zaeo;
28331         dref = ( refa + refb*tz*tz ) * tz;
28332         zdt = zdo + dref;
28333 
28334         /* To Cartesian Az,ZD. */
28335         ce = sin(zdt);
28336         xaet = cos(az) * ce;
28337         yaet = sin(az) * ce;
28338         zaet = cos(zdt);
28339 
28340         /* Cartesian Az,ZD to Cartesian -HA,Dec. */
28341         xmhda = sphi*xaet + cphi*zaet;
28342         ymhda = yaet;
28343         zmhda = - cphi*xaet + sphi*zaet;
28344 
28345         /* Diurnal aberration. */
28346         f = ( 1.0 + astrom.diurab*ymhda );
28347         xhd = f * xmhda;
28348         yhd = f * ( ymhda - astrom.diurab );
28349         zhd = f * zmhda;
28350 
28351         /* Polar motion. */
28352         xpl = astrom.xpl;
28353         ypl = astrom.ypl;
28354         w = xpl*xhd - ypl*yhd + zhd;
28355         v[0] = xhd - xpl*w;
28356         v[1] = yhd + ypl*w;
28357         v[2] = w - ( xpl*xpl + ypl*ypl ) * zhd;
28358 
28359         /* To spherical -HA,Dec. */
28360         SphericalCoordinate co = jauC2s(v);
28361 
28362         /* Right ascension. */
28363         co.alpha = jauAnp(astrom.eral + co.alpha);
28364 
28365         return co;
28366         /* Finished. */
28367 
28368 
28369     }
28370 
28371     /**
28372      *  Apply light deflection by a solar-system body, as part of
28373      *  transforming coordinate direction into natural direction.
28374      *
28375      *<p>This function is derived from the International Astronomical Union's
28376      *  SOFA (Standards of Fundamental Astronomy) software collection.
28377      *
28378      *<p>Status:  support function.
28379      *
28380      *<!-- Given: -->
28381      *     @param bm      double      mass of the gravitating body (solar masses)
28382      *     @param p       double[3]   direction from observer to source (unit vector)
28383      *     @param q       double[3]   direction from body to source (unit vector)
28384      *     @param e       double[3]   direction from body to observer (unit vector)
28385      *     @param em      double      distance from body to observer (au)
28386      *     @param dlim    double      deflection limiter (Note 4)
28387      *
28388      *<!-- Returned:-->
28389      *     @return p1      double[3]    <b>Returned</b> observer to deflected source (unit vector)
28390      *
28391      *<p>Notes:
28392      * <ol>
28393      *
28394      *  <li> The algorithm is based on Expr. (70) in Klioner (2003) and
28395      *     Expr. (7.63) in the Explanatory Supplement (Urban &amp; Seidelmann
28396      *     2013), with some rearrangement to minimize the effects of machine
28397      *     precision.
28398      *
28399      *  <li> The mass parameter bm can, as required, be adjusted in order to
28400      *     allow for such effects as quadrupole field.
28401      *
28402      *  <li> The barycentric position of the deflecting body should ideally
28403      *     correspond to the time of closest approach of the light ray to
28404      *     the body.
28405      *
28406      *  <li> The deflection limiter parameter dlim is phi^2/2, where phi is
28407      *     the angular separation (in radians) between source and body at
28408      *     which limiting is applied.  As phi shrinks below the chosen
28409      *     threshold, the deflection is artificially reduced, reaching zero
28410      *     for phi = 0.
28411      *
28412      *  <li> The returned vector p1 is not normalized, but the consequential
28413      *     departure from unit magnitude is always negligible.
28414      *
28415      *  <li> The arguments p and p1 can be the same array.
28416      *
28417      *  <li> To accumulate total light deflection taking into account the
28418      *     contributions from several bodies, call the present function for
28419      *     each body in succession, in decreasing order of distance from the
28420      *     observer.
28421      *
28422      *  <li> For efficiency, validation is omitted.  The supplied vectors must
28423      *     be of unit magnitude, and the deflection limiter non-zero and
28424      *     positive.
28425      *
28426      * </ol>
28427      *<p>References:
28428      * <ul>
28429      *
28430      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28431      *     the Astronomical Almanac, 3rd ed., University Science Books
28432      *     (2013).
28433      *
28434      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
28435      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
28436      *
28437      * </ul>
28438      *  Called:
28439      * <ul>
28440      *     <li>{@link #jauPdp} scalar product of two p-vectors
28441      *     <li>{@link #jauPxp} vector product of two p-vectors
28442      *
28443      * </ul>
28444      *@version  2013 October 9
28445      *
28446      *@since JSOFA release 20131202
28447      *
28448      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28449      */
28450     public static double[] jauLd(double bm, double p[], double q[], double e[],
28451             double em, double dlim)
28452     {
28453         int i;
28454         double qpe[] = new double[3], qdqpe, w, eq[], peq[] ;
28455 
28456         double p1[] = new double[3];
28457 
28458         /* q . (q + e). */
28459         for (i = 0; i < 3; i++) {
28460             qpe[i] = q[i] + e[i];
28461         }
28462         qdqpe = jauPdp(q, qpe);
28463 
28464         /* 2 x G x bm / ( em x c^2 x ( q . (q + e) ) ). */
28465         w = bm * SRS / em / max(qdqpe,dlim);
28466 
28467         /* p x (e x q). */
28468         eq = jauPxp(e, q);
28469         peq = jauPxp(p, eq);
28470 
28471         /* Apply the deflection. */
28472         for (i = 0; i < 3; i++) {
28473             p1[i] = p[i] + w*peq[i];
28474         }
28475 
28476         return p1;
28477         /* Finished. */
28478 
28479 
28480     }
28481 
28482     /*+
28483      *  - - - - - - -
28484      *   i a u L d n
28485      *  - - - - - - -
28486      *
28487      *  For a star, apply light deflection by multiple solar-system bodies,
28488      *  as part of transforming coordinate direction into natural direction.
28489      *
28490      *<p>This function is derived from the International Astronomical Union's
28491      *  SOFA (Standards of Fundamental Astronomy) software collection.
28492      *
28493      *<p>Status:  support function.
28494      *
28495      *<!-- Given: -->
28496      *     n    int           number of bodies (note 1)
28497      *     b    jauLDBODY[n]  data for each of the n bodies (Notes 1,2):
28498      *      bm   double         mass of the body (solar masses, Note 3)
28499      *      dl   double         deflection limiter (Note 4)
28500      *      pv   [2][3]         barycentric PV of the body (au, au/day)
28501      *     ob   double[3]     barycentric position of the observer (au)
28502      *     sc   double[3]     observer to star coord direction (unit vector)
28503      *
28504      *<!-- Returned:-->
28505      *     sn    double[3]      observer to deflected star (unit vector)
28506      *
28507      *  <li> The array b contains n entries, one for each body to be
28508      *     considered.  If n = 0, no gravitational light deflection will be
28509      *     applied, not even for the Sun.
28510      *
28511      *  <li> The array b should include an entry for the Sun as well as for
28512      *     any planet or other body to be taken into account.  The entries
28513      *     should be in the order in which the light passes the body.
28514      *
28515      *  <li> In the entry in the b array for body i, the mass parameter
28516      *     b[i].bm can, as required, be adjusted in order to allow for such
28517      *     effects as quadrupole field.
28518      *
28519      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
28520      *     the angular separation (in radians) between star and body at
28521      *     which limiting is applied.  As phi shrinks below the chosen
28522      *     threshold, the deflection is artificially reduced, reaching zero
28523      *     for phi = 0.   Example values suitable for a terrestrial
28524      *     observer, together with masses, are as follows:
28525      *
28526      *        body i     b[i].bm        b[i].dl
28527      *
28528      *        Sun        1.0            6e-6
28529      *        Jupiter    0.00095435     3e-9
28530      *        Saturn     0.00028574     3e-10
28531      *
28532      *  <li> For cases where the starlight passes the body before reaching the
28533      *     observer, the body is placed back along its barycentric track by
28534      *     the light time from that point to the observer.  For cases where
28535      *     the body is "behind" the observer no such shift is applied.  If
28536      *     a different treatment is preferred, the user has the option of
28537      *     instead using the iauLd function.  Similarly, iauLd can be used
28538      *     for cases where the source is nearby, not a star.
28539      *
28540      *  <li> The returned vector sn is not normalized, but the consequential
28541      *     departure from unit magnitude is always negligible.
28542      *
28543      *  <li> The arguments sc and sn can be the same array.
28544      *
28545      *  <li> For efficiency, validation is omitted.  The supplied masses must
28546      *     be greater than zero, the position and velocity vectors must be
28547      *     right, and the deflection limiter greater than zero.
28548      *
28549      *  Reference:
28550      *
28551      *     Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28552      *     the Astronomical Almanac, 3rd ed., University Science Books
28553      *     (2013), Section 7.2.4.
28554      *
28555      *  Called:
28556      *     iauCp        copy p-vector
28557      *     iauPdp       scalar product of two p-vectors
28558      *     iauPmp       p-vector minus p-vector
28559      *     iauPpsp      p-vector plus scaled p-vector
28560      *     iauPn        decompose p-vector into modulus and direction
28561      *     iauLd        light deflection by a solar-system body
28562      *
28563      *@version  2013 October 9
28564      *
28565      *@since JSOFA release 20131202
28566      *
28567      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28568      */
28569     public static double[] jauLdn(int n, Ldbody b[], double ob[], double sc[])
28570     {
28571         /* Light time for 1 au (days) */
28572         final double CR = AULT/DAYSEC;
28573 
28574         int i;
28575         double v[] , dt, ev[], sn[] = new double[3];
28576 
28577 
28578         /* Star direction prior to deflection. */
28579         jauCp(sc, sn);
28580 
28581         /* Body by body. */
28582         for ( i = 0; i < n; i++ ) {
28583 
28584             /* Body to observer vector at epoch of observation (au). */
28585             v = jauPmp( ob, b[i].pv[0]);
28586 
28587             /* Minus the time since the light passed the body (days). */
28588             dt = jauPdp(sn,v) * CR;
28589 
28590             /* Neutralize if the star is "behind" the observer. */
28591             dt = min(dt, 0.0);
28592 
28593             /* Backtrack the body to the time the light was passing the body. */
28594             ev = jauPpsp(v, -dt, b[i].pv[1]);
28595 
28596             /* Body to observer vector as magnitude and direction. */
28597             NormalizedVector nv = jauPn(ev);
28598             
28599             /* Apply light deflection for this body. */
28600             sn = jauLd( b[i].bm, sn, sn, nv.u, nv.r, b[i].dl );
28601 
28602             /* Next body. */
28603         }
28604         return sn;
28605 
28606         /* Finished. */
28607 
28608 
28609     }
28610 
28611     /**
28612      *   Deflection of starlight by the Sun.
28613      *
28614      *<p>This function is derived from the International Astronomical Union's
28615      *  SOFA (Standards of Fundamental Astronomy) software collection.
28616      *
28617      *<p>Status:  support function.
28618      *
28619      *<!-- Given: -->
28620      *     @param p       double[3]   direction from observer to star (unit vector)
28621      *     @param e       double[3]   direction from Sun to observer (unit vector)
28622      *     @param em      double      distance from Sun to observer (au)
28623      *
28624      *<!-- Returned:-->
28625      *     @return p1      double[3]    <b>Returned</b> observer to deflected start (unit vector)
28626      *
28627      *<p>Notes:
28628      * <ol>
28629      *
28630      *  <li> The source is presumed to be sufficiently distant that its
28631      *     directions seen from the Sun and the observer are essentially
28632      *     the same.
28633      *
28634      *  <li> The deflection is restrained when the angle between the star and
28635      *     the center of the Sun is less than a threshold value, falling to
28636      *     zero deflection for zero separation.  The chosen threshold value
28637      *     is within the solar limb for all solar-system applications, and
28638      *     is about 5 arcminutes for the case of a terrestrial observer.
28639      *
28640      *  <li> The arguments p and p1 can be the same array.
28641      *
28642      * </ol>
28643      *  Called:
28644      * <ul>
28645      *     <li>{@link #jauLd} light deflection by a solar-system body
28646      *
28647      * </ul>
28648      *@version  2016 July 29
28649      *
28650      *@since JSOFA release 20131202
28651      *
28652      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28653      */
28654     public static double[] jauLdsun(double p[], double e[], double em)
28655     {
28656         double em2, dlim;
28657 
28658 
28659         /* Deflection limiter (smaller for distant observers). */
28660         em2 = em*em;
28661         if ( em2 < 1.0 ) em2 = 1.0;
28662         dlim = 1e-6 / (em2 > 1.0 ? em2 : 1.0);
28663         
28664         /* Apply the deflection. */
28665         return jauLd(1.0, p, p, e, em, dlim);
28666 
28667     }
28668 
28669     /**
28670      *  Proper motion and parallax.
28671      *
28672      *<p>This function is derived from the International Astronomical Union's
28673      *  SOFA (Standards of Fundamental Astronomy) software collection.
28674      *
28675      *<p>Status:  support function.
28676      *
28677      *<!-- Given: -->
28678      *     @param rc double      ICRS RA,Dec at catalog epoch (radians)
28679      *     @param dc double      ICRS RA,Dec at catalog epoch (radians) 
28680      *     @param pr      double      RA proper motion (radians/year; Note 1)
28681      *     @param pd      double      Dec proper motion (radians/year)
28682      *     @param px      double      parallax (arcsec)
28683      *     @param rv      double      radial velocity (km/s, +ve if receding)
28684      *     @param pmt     double      proper motion time interval (SSB, Julian years)
28685      *     @param pob     double[3]   SSB to observer vector (au)
28686      *
28687      *<!-- Returned:-->
28688      *     @return pco     double[3]    <b>Returned</b> coordinate direction (BCRS unit vector)
28689      *
28690      *<p>Notes:
28691      * <ol>
28692      *
28693      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
28694      *
28695      *  <li> The proper motion time interval is for when the starlight
28696      *     reaches the solar system barycenter.
28697      *
28698      *  <li> To avoid the need for iteration, the Roemer effect (i.e. the
28699      *     small annual modulation of the proper motion coming from the
28700      *     changing light time) is applied approximately, using the
28701      *     direction of the star at the catalog epoch.
28702      *
28703      * </ol>
28704      *<p>References:
28705      * <ul>
28706      *
28707      * <li> 1984 Astronomical Almanac, pp B39-B41.
28708      *
28709      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28710      *     the Astronomical Almanac, 3rd ed., University Science Books
28711      *     (2013), Section 7.2.
28712      *
28713      * </ul>
28714      *  Called:
28715      * <ul>
28716      *     <li>{@link #jauPdp} scalar product of two p-vectors
28717      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
28718      *
28719      * </ul>
28720      *@version  2013 October 9
28721      *
28722      *@since JSOFA release 20131202
28723      *
28724      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28725      */
28726     public static double[] jauPmpx(double rc, double dc, double pr, double pd,
28727             double px, double rv, double pmt, double pob[]
28728             )
28729     {
28730         /* Km/s to au/year */
28731         final double VF = DAYSEC*DJM/DAU;
28732 
28733         /* Light time for 1 au, Julian years */
28734         final double AULTY = AULT/DAYSEC/DJY;
28735 
28736         int i;
28737         double sr, cr, sd, cd, x, y, z, p[] = new double[3], dt, pxr, w, pdz, pm[] = new double[3];
28738 
28739 
28740         /* Spherical coordinates to unit vector (and useful functions). */
28741         sr = sin(rc);
28742         cr = cos(rc);
28743         sd = sin(dc);
28744         cd = cos(dc);
28745         p[0] = x = cr*cd;
28746         p[1] = y = sr*cd;
28747         p[2] = z = sd;
28748 
28749         /* Proper motion time interval (y) including Roemer effect. */
28750         dt = pmt + jauPdp(p,pob)*AULTY;
28751 
28752         /* Space motion (radians per year). */
28753         pxr = px * DAS2R;
28754         w = VF * rv * pxr;
28755         pdz = pd * z;
28756         pm[0] = - pr*y - pdz*cr + w*x;
28757         pm[1] =   pr*x - pdz*sr + w*y;
28758         pm[2] =   pd*cd + w*z;
28759 
28760         /* Coordinate direction of star (unit vector, BCRS). */
28761         for (i = 0; i < 3; i++) {
28762             p[i] += dt*pm[i] - pxr*pob[i];
28763         }
28764         NormalizedVector pco = jauPn(p);
28765 
28766         return pco.u;
28767         /* Finished. */
28768 
28769 
28770     }
28771 
28772     /**
28773      *  Star proper motion:  update star catalog data for space motion, with
28774      *  special handling to handle the zero parallax case.
28775      *
28776      *<p>This function is derived from the International Astronomical Union's
28777      *  SOFA (Standards of Fundamental Astronomy) software collection.
28778      *
28779      *<p>Status:  support function.
28780      *
28781      *<!-- Given: -->
28782      *     @param ra1     double       right ascension (radians), before
28783      *     @param dec1    double       declination (radians), before
28784      *     @param pmr1    double       RA proper motion (radians/year), before
28785      *     @param pmd1    double       Dec proper motion (radians/year), before
28786      *     @param px1     double       parallax (arcseconds), before
28787      *     @param rv1     double       radial velocity (km/s, +ve = receding), before
28788      *     @param ep1a    double       "before" epoch, part A (Note 1)
28789      *     @param ep1b    double       "before" epoch, part B (Note 1)
28790      *     @param ep2a    double       "after" epoch, part A (Note 1)
28791      *     @param ep2b    double       "after" epoch, part B (Note 1)
28792      *
28793      *<!-- Returned:-->
28794      *     @return ra2     double        <b>Returned</b> right ascension (radians), after
28795      *             dec2    double        <b>Returned</b> declination (radians), after
28796      *             pmr2    double        <b>Returned</b> RA proper motion (radians/year), after
28797      *             pmd2    double        <b>Returned</b> Dec proper motion (radians/year), after
28798      *             px2     double        <b>Returned</b> parallax (arcseconds), after
28799      *             rv2     double        <b>Returned</b> radial velocity (km/s, +ve = receding), after
28800      *
28801      *  
28802      *  @throws JSOFAInternalError          int         status:
28803      *                         -1  =   <b>Returned</b> system error (should not occur)
28804      *                          0  =   <b>Returned</b> no warnings or errors
28805      *                          1  =   <b>Returned</b> distance overridden (Note 6)
28806      *                          2  =   <b>Returned</b> excessive velocity (Note 7)
28807      *                          4  =   <b>Returned</b> solution didn't converge (Note 8)
28808      *                        else  =   <b>Returned</b> binary logical OR of the above warnings
28809      *
28810      *<p>Notes:
28811      * <ol>
28812      *
28813      *  <li> The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are
28814      *     Julian Dates, apportioned in any convenient way between the two
28815      *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
28816      *     expressed in any of these ways, among others:
28817      *
28818      *            <p>epNa            epNb
28819      *
28820      *         2450123.7           0.0       (JD method)
28821      *         2451545.0       -1421.3       (J2000 method)
28822      *         2400000.5       50123.2       (MJD method)
28823      *         2450123.5           0.2       (date &amp; time method)
28824      *
28825      *     <p>The JD method is the most natural and convenient to use in cases
28826      *     where the loss of several decimal digits of resolution is
28827      *     acceptable.  The J2000 method is best matched to the way the
28828      *     argument is handled internally and will deliver the optimum
28829      *     resolution.  The MJD method and the date &amp; time methods are both
28830      *     good compromises between resolution and convenience.
28831      *
28832      *  <li> In accordance with normal star-catalog conventions, the object's
28833      *     right ascension and declination are freed from the effects of
28834      *     secular aberration.  The frame, which is aligned to the catalog
28835      *     equator and equinox, is Lorentzian and centered on the SSB.
28836      *
28837      *     <p>The proper motions are the rate of change of the right ascension
28838      *     and declination at the catalog epoch and are in radians per TDB
28839      *     Julian year.
28840      *
28841      *     <p>The parallax and radial velocity are in the same frame.
28842      *
28843      *  <li> Care is needed with units.  The star coordinates are in radians
28844      *     and the proper motions in radians per Julian year, but the
28845      *     parallax is in arcseconds.
28846      *
28847      *  <li> The RA proper motion is in terms of coordinate angle, not true
28848      *     angle.  If the catalog uses arcseconds for both RA and Dec proper
28849      *     motions, the RA proper motion will need to be divided by cos(Dec)
28850      *     before use.
28851      *
28852      *  <li> Straight-line motion at constant speed, in the inertial frame, is
28853      *     assumed.
28854      *
28855      *  <li> An extremely small (or zero or negative) parallax is overridden
28856      *     to ensure that the object is at a finite but very large distance,
28857      *     but not so large that the proper motion is equivalent to a large
28858      *     but safe speed (about 0.1c using the chosen constant).  A warning
28859      *     status of 1 is added to the status if this action has been taken.
28860      *
28861      *  <li> If the space velocity is a significant fraction of c (see the
28862      *     constant VMAX in the function iauStarpv), it is arbitrarily set
28863      *     to zero.  When this action occurs, 2 is added to the status.
28864      *
28865      *  <li> The relativistic adjustment carried out in the iauStarpv function
28866      *     involves an iterative calculation.  If the process fails to
28867      *     converge within a set number of iterations, 4 is added to the
28868      *     status.
28869      *
28870      * </ol>
28871      *  Called:
28872      * <ul>
28873      *     <li>{@link #jauSeps} angle between two points
28874      *     <li>{@link #jauStarpm} update star catalog data for space motion
28875      *
28876      * </ul>
28877      *@version  2013 October 9
28878      *
28879      *@since JSOFA release 20131202
28880      *
28881      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28882      * @throws JSOFAInternalError an internal error has occured
28883      */
28884     public static CatalogCoords jauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
28885             double px1, double rv1,
28886             double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
28887     {
28888 
28889         /* Minimum allowed parallax (arcsec) */
28890         final double PXMIN = 5e-7;
28891 
28892         /* Factor giving maximum allowed transverse speed of about 1% c */
28893         final double F = 326.0;
28894 
28895         double pm, px1a;
28896 
28897 
28898         /* Proper motion in one year (radians). */
28899         pm = jauSeps(ra1, dec1, ra1+pmr1, dec1+pmd1);
28900 
28901         
28902         px1a = px1;
28903         pm *= F;
28904         if (px1a < pm) {px1a = pm;}
28905         if (px1a < PXMIN) {px1a = PXMIN;}
28906 
28907         /* Carry out the transformation using the modified parallax. */
28908         return jauStarpm(ra1, dec1, pmr1, pmd1, px1a, rv1,
28909                 ep1a, ep1b, ep2a, ep2b);
28910 
28911          /* Finished. */
28912 
28913 
28914     }
28915 
28916     /**
28917      *  Position and velocity of a terrestrial observing station.
28918      *
28919      *<p>This function is derived from the International Astronomical Union's
28920      *  SOFA (Standards of Fundamental Astronomy) software collection.
28921      *
28922      *<p>Status:  support function.
28923      *
28924      *<!-- Given: -->
28925      *     @param elong    double        longitude (radians, east +ve, Note 1)
28926      *     @param phi      double        latitude (geodetic, radians, Note 1)
28927      *     @param hm       double        height above ref. ellipsoid (geodetic, m)
28928      *     @param xp double        coordinates of the pole (radians, Note 2)
28929      *     @param yp double        coordinates of the pole (radians, Note 2) 
28930      *     @param sp       double        the TIO locator s' (radians, Note 2)
28931      *     @param theta    double        Earth rotation angle (radians, Note 3)
28932      *
28933      *<!-- Returned:-->
28934      *     @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
28935      *
28936      *<p>Notes:
28937      * <ol>
28938      *
28939      *  <li> The terrestrial coordinates are with respect to the WGS84
28940      *     reference ellipsoid.
28941      *
28942      *  <li> xp and yp are the coordinates (in radians) of the Celestial
28943      *     Intermediate Pole with respect to the International Terrestrial
28944      *     Reference System (see IERS Conventions), measured along the
28945      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
28946      *     s', in radians, which positions the Terrestrial Intermediate
28947      *     Origin on the equator.  For many applications, xp, yp and
28948      *     (especially) sp can be set to zero.
28949      *
28950      *  <li> If theta is Greenwich apparent sidereal time instead of Earth
28951      *     rotation angle, the result is with respect to the true equator
28952      *     and equinox of date, i.e. with the x-axis at the equinox rather
28953      *     than the celestial intermediate origin.
28954      *
28955      *  <li> The velocity units are meters per UT1 second, not per SI second.
28956      *     This is unlikely to have any practical consequences in the modern
28957      *     era.
28958      *
28959      *  <li> No validation is performed on the arguments.  Error cases that
28960      *     could lead to arithmetic exceptions are trapped by the iauGd2gc
28961      *     function, and the result set to zeros.
28962      *
28963      * </ol>
28964      *<p>References:
28965      * <ul>
28966      *
28967      * <li> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
28968      *     IERS Technical Note No. 32, BKG (2004)
28969      *
28970      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28971      *     the Astronomical Almanac, 3rd ed., University Science Books
28972      *     (2013), Section 7.4.3.3.
28973      *
28974      * </ul>
28975      *  Called:
28976      * <ul>
28977      *     <li>{@link #jauGd2gc} geodetic to geocentric transformation
28978      *     <li>{@link #jauPom00} polar motion matrix
28979      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
28980      *
28981      * </ul>
28982      *@version  2013 October 9
28983      *
28984      * @since JSOFA release 20131202
28985      *
28986      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28987      * @throws JSOFAInternalError an internal error has occured
28988      * @throws JSOFAIllegalParameter 
28989      */
28990     public static double [][] jauPvtob(double elong, double phi, double hm,
28991             double xp, double yp, double sp, double theta
28992             ) throws JSOFAIllegalParameter, JSOFAInternalError
28993     {
28994 
28995         double xyzm[];
28996 
28997         /* Geodetic to geocentric transformation (WGS84). */
28998         xyzm = jauGd2gc(1, elong, phi, hm);
28999 
29000         return jauPvtob(xyzm, xp, yp, sp, theta );
29001         /* Finished. */
29002 
29003 
29004     }
29005     
29006     /**
29007      * Alternative Position and velocity of a terrestrial observing station with observatory position already in cartesian.
29008      * @see JSOFA#jauPvtob(double, double, double, double, double, double, double) for more detail.
29009      * @param xyzm observatory geocentric position in metres.
29010      * @param xp double        coordinates of the pole (radians, Note 2)
29011      * @param yp double        coordinates of the pole (radians, Note 2) 
29012      * @param sp       double        the TIO locator s' (radians, Note 2)
29013      * @param theta    double        Earth rotation angle (radians, Note 3)
29014      * @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
29015      * @throws JSOFAIllegalParameter
29016      * @throws JSOFAInternalError an internal error has occured
29017      */
29018     public static double [][] jauPvtob(double xyzm[],
29019             double xp, double yp, double sp, double theta
29020             ) throws JSOFAIllegalParameter, JSOFAInternalError
29021     {
29022         /* Earth rotation rate in radians per UT1 second */
29023         final double OM = 1.00273781191135448 * D2PI / DAYSEC;
29024 
29025         double rpm[][], xyz[], x, y, z, s, c;
29026         double pv[][] = new double[2][3];
29027 
29028       
29029         /* Polar motion and TIO position. */
29030         rpm = jauPom00(xp, yp, sp);
29031         xyz = jauTrxp(rpm, xyzm);
29032         x = xyz[0];
29033         y = xyz[1];
29034         z = xyz[2];
29035 
29036         /* Functions of ERA. */
29037         s = sin(theta);
29038         c = cos(theta);
29039 
29040         /* Position. */
29041         pv[0][0] = c*x - s*y;
29042         pv[0][1] = s*x + c*y;
29043         pv[0][2] = z;
29044 
29045         /* Velocity. */
29046         pv[1][0] = OM * ( -s*x - c*y );
29047         pv[1][1] = OM * (  c*x - s*y );
29048         pv[1][2] = 0.0;
29049 
29050         return pv;
29051         /* Finished. */
29052 
29053 
29054     }
29055 
29056     /**
29057      * constants A and B in the atmospheric refraction model
29058      *  dZ = A tan Z + B tan^3 Z.
29059      *  .
29060      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
29061      * @version $Revision$ $date$
29062      */
29063     public static class RefCos {
29064         /**    refraction coefficient A  */
29065         public double    a ;
29066 
29067         /**    refraction coefficient B  */
29068         public double    b ;
29069         public RefCos(double a, double b) {
29070           this.a = a;
29071           this.b = b;
29072        }
29073        
29074    }
29075 
29076     /**
29077      *  Determine the constants A and B in the atmospheric refraction model
29078      *  dZ = A tan Z + B tan^3 Z.
29079      *
29080      *  Z is the "observed" zenith distance (i.e. affected by refraction)
29081      *  and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
29082      *  zenith distance.
29083      *
29084      *<p>This function is derived from the International Astronomical Union's
29085      *  SOFA (Standards of Fundamental Astronomy) software collection.
29086      *
29087      *<p>Status:  support function.
29088      *
29089      *<!-- Given: -->
29090      *    @param phpa    double     pressure at the observer (hPa = millibar)
29091      *    @param tc      double     ambient temperature at the observer (deg C)
29092      *    @param rh      double     relative humidity at the observer (range 0-1)
29093      *    @param wl      double     wavelength (micrometers)
29094      *
29095      *<!-- Returned:-->
29096      *    @return      <b>Returned</b> tan Z coefficient (radians)
29097      *                 <b>Returned</b> tan^3 Z coefficient (radians)
29098      *
29099      *<p>Notes:
29100      * <ol>
29101      *
29102      *  <li> The model balances speed and accuracy to give good results in
29103      *     applications where performance at low altitudes is not paramount.
29104      *     Performance is maintained across a range of conditions, and
29105      *     applies to both optical/IR and radio.
29106      *
29107      *  <li> The model omits the effects of (i) height above sea level (apart
29108      *     from the reduced pressure itself), (ii) latitude (i.e. the
29109      *     flattening of the Earth), (iii) variations in tropospheric lapse
29110      *     rate and (iv) dispersive effects in the radio.
29111      *
29112      *     <p>The model was tested using the following range of conditions:
29113      *
29114      *       <p>lapse rates 0.0055, 0.0065, 0.0075 deg/meter
29115      *       latitudes 0, 25, 50, 75 degrees
29116      *       heights 0, 2500, 5000 meters ASL
29117      *       pressures mean for height -10% to +5% in steps of 5%
29118      *       temperatures -10 deg to +20 deg with respect to 280 deg at SL
29119      *       relative humidity 0, 0.5, 1
29120      *       wavelengths 0.4, 0.6, ... 2 micron, + radio
29121      *       zenith distances 15, 45, 75 degrees
29122      *
29123      *     <p>The accuracy with respect to raytracing through a model
29124      *     atmosphere was as follows:
29125      *
29126      *                            <p>worst         RMS
29127      *
29128      *       <p>optical/IR           62 mas       8 mas
29129      *       radio               319 mas      49 mas
29130      *
29131      *     <p>For this particular set of conditions:
29132      *
29133      *       <p>lapse rate 0.0065 K/meter
29134      *       latitude 50 degrees
29135      *       sea level
29136      *       pressure 1005 mb
29137      *       temperature 280.15 K
29138      *       humidity 80%
29139      *       wavelength 5740 Angstroms
29140      *
29141      *     <p>the results were as follows:
29142      *
29143      *       <p>ZD       raytrace     iauRefco   Saastamoinen
29144      *
29145      *       10         10.27        10.27        10.27
29146      *       20         21.19        21.20        21.19
29147      *       30         33.61        33.61        33.60
29148      *       40         48.82        48.83        48.81
29149      *       45         58.16        58.18        58.16
29150      *       50         69.28        69.30        69.27
29151      *       55         82.97        82.99        82.95
29152      *       60        100.51       100.54       100.50
29153      *       65        124.23       124.26       124.20
29154      *       70        158.63       158.68       158.61
29155      *       72        177.32       177.37       177.31
29156      *       74        200.35       200.38       200.32
29157      *       76        229.45       229.43       229.42
29158      *       78        267.44       267.29       267.41
29159      *       80        319.13       318.55       319.10
29160      *
29161      *      <p>deg        arcsec       arcsec       arcsec
29162      *
29163      *     <p>The values for Saastamoinen's formula (which includes terms
29164      *     up to tan^5) are taken from Hohenkerk and Sinclair (1985).
29165      *
29166      *  <li> A wl value in the range 0-100 selects the optical/IR case and is
29167      *     wavelength in micrometers.  Any value outside this range selects
29168      *     the radio case.
29169      *
29170      *  <li> Outlandish input parameters are silently limited to
29171      *     mathematically safe values.  Zero pressure is permissible, and
29172      *     causes zeroes to be returned.
29173      *
29174      *  <li> The algorithm draws on several sources, as follows:
29175      *
29176      *     <p>a) The formula for the saturation vapour pressure of water as
29177      *        a function of temperature and temperature is taken from
29178      *        Equations (A4.5-A4.7) of Gill (1982).
29179      *
29180      *     <p>b) The formula for the water vapour pressure, given the
29181      *        saturation pressure and the relative humidity, is from
29182      *        Crane (1976), Equation (2.5.5).
29183      *
29184      *     <p>c) The refractivity of air is a function of temperature,
29185      *        total pressure, water-vapour pressure and, in the case
29186      *        of optical/IR, wavelength.  The formulae for the two cases are
29187      *        developed from Hohenkerk &amp; Sinclair (1985) and Rueger (2002).
29188      *
29189      *     <p>d) The formula for beta, the ratio of the scale height of the
29190      *        atmosphere to the geocentric distance of the observer, is
29191      *        an adaption of Equation (9) from Stone (1996).  The
29192      *        adaptations, arrived at empirically, consist of (i) a small
29193      *        adjustment to the coefficient and (ii) a humidity term for the
29194      *        radio case only.
29195      *
29196      *     <p>e) The formulae for the refraction constants as a function of
29197      *        n-1 and beta are from Green (1987), Equation (4.31).
29198      *
29199      * </ol>
29200      *<p>References:
29201      * <ul>
29202      *
29203      * <li> Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral
29204      *     Atmosphere", Methods of Experimental Physics: Astrophysics 12B,
29205      *     Academic Press, 1976.
29206      *
29207      * <li> Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press,
29208      *     1982.
29209      *
29210      * <li> Green, R.M., "Spherical Astronomy", Cambridge University Press,
29211      *     1987.
29212      *
29213      * <li> Hohenkerk, C.Y., &amp; Sinclair, A.T., NAO Technical Note No. 63,
29214      *     1985.
29215      *
29216      * <li> Rueger, J.M., "Refractive Index Formulae for Electronic Distance
29217      *     Measurement with Radio and Millimetre Waves", in Unisurv Report
29218      *     S-68, School of Surveying and Spatial Information Systems,
29219      *     University of New South Wales, Sydney, Australia, 2002.
29220      *
29221      * <li> Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996.
29222      *
29223      * </ul>
29224      *@version  2013 October 9
29225      *
29226      *@since JSOFA release 20131202
29227      *
29228      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29229      */
29230     public static RefCos jauRefco(double phpa, double tc, double rh, double wl )
29231     {
29232         boolean optic;
29233         double p, t, r, w, ps, pw, tk, wlsq, gamma, beta;
29234 
29235 
29236         /* Decide whether optical/IR or radio case:  switch at 100 microns. */
29237         optic = ( wl <= 100.0 );
29238 
29239         /* Restrict parameters to safe values. */
29240         t = max ( tc, -150.0 );
29241         t = min ( t, 200.0 );
29242         p = max ( phpa, 0.0 );
29243         p = min ( p, 10000.0 );
29244         r = max ( rh, 0.0 );
29245         r = min ( r, 1.0 );
29246         w = max ( wl, 0.1 );
29247         w = min ( w, 1e6 );
29248 
29249         /* Water vapour pressure at the observer. */
29250         if ( p > 0.0 ) {
29251             ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) /
29252                     ( 1.0 + 0.00412*t ) ) *
29253                     ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t )  );
29254             pw = r * ps / ( 1.0 - (1.0-r)*ps/p );
29255         } else {
29256             pw = 0.0;
29257         }
29258 
29259         /* Refractive index minus 1 at the observer. */
29260         tk = t + 273.15;
29261         if ( optic ) {
29262             wlsq = w * w;
29263             gamma = ( ( 77.53484e-6 +
29264                     ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p
29265                     - 11.2684e-6*pw ) / tk;
29266         } else {
29267             gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk;
29268         }
29269 
29270         /* Formula for beta from Stone, with empirical adjustments. */
29271         beta = 4.4474e-6 * tk;
29272         if ( ! optic ) beta -= 0.0074 * pw * beta;
29273 
29274         /* Refraction constants from Green. */
29275         return new RefCos( gamma * ( 1.0 - beta ),
29276                - gamma * ( beta - gamma / 2.0 ));
29277 
29278         /* Finished. */
29279 
29280 
29281     }
29282  
29283     
29284     /**
29285     *  Transformation from Galactic Coordinates to ICRS.
29286     *
29287     *  This function is derived from the International Astronomical Union's
29288     *  SOFA (Standards of Fundamental Astronomy) software collection.
29289     *
29290     *  <p>Status:  support routine.
29291     *
29292     *  @param   dl     double      galactic longitude (radians)
29293     *  @param   db     double      galactic latitude (radians)
29294     *
29295     *  @return co ICRS right ascension, declination.
29296     *
29297     *  <p>Notes:<ol>
29298     *
29299     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29300     *     respect to the now obsolete reference system FK4 B1950.0.  When
29301     *     interpreting the system in a modern context, several factors have
29302     *     to be taken into account:<ul>
29303     *
29304     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29305     *
29306     *     <li> The distortion of the FK4 proper motion system by differential
29307     *       Galactic rotation.
29308     *
29309     *     <li> The use of the B1950.0 equinox rather than the now-standard
29310     *       J2000.0.
29311     *
29312     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29313     *  </ul>
29314     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29315     *     matrix that transforms directly between ICRS and Galactic
29316     *     coordinates with the above factors taken into account.  The
29317     *     matrix is derived from three angles, namely the ICRS coordinates
29318     *     of the Galactic pole and the longitude of the ascending node of
29319     *     the galactic equator on the ICRS equator.  They are given in
29320     *     degrees to five decimal places and for canonical purposes are
29321     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29322     *     elements are given to 10 decimal places (about 20 microarcsec).
29323     *     In the present SOFA function the matrix elements have been
29324     *     recomputed from the canonical three angles and are given to 30
29325     *     decimal places.
29326     *
29327     *  <li> The inverse transformation is performed by the function jauIcrs2g.
29328     *  </ol>
29329     *
29330     *  Reference:
29331     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29332     *     catalogues.  Astrometric and photometric star catalogues
29333     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29334     *     Publications Division, Noordwijk, Netherlands.
29335     *
29336     *  @version  2015 March 02
29337     * 
29338     *
29339     *  @since JSOFA release 20150209
29340     *
29341     */
29342     public static SphericalCoordinate jauG2icrs ( double dl, double db)
29343     {
29344        double v1[], v2[];
29345 
29346     /*
29347     *  L2,B2 system of galactic coordinates in the form presented in the
29348     *  Hipparcos Catalogue.  In degrees:
29349     *
29350     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29351     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29352     *  R =  32.93192    longitude of the ascending node of the Galactic
29353     *                   plane on the ICRS equator
29354     *
29355     *  ICRS to galactic rotation matrix, obtained by computing
29356     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29357     */
29358        double r[][]  = new double[][]{ { -0.054875560416215368492398900454,
29359                             -0.873437090234885048760383168409,
29360                             -0.483835015548713226831774175116 },
29361                           { +0.494109427875583673525222371358,
29362                             -0.444829629960011178146614061616,
29363                             +0.746982244497218890527388004556 },
29364                           { -0.867666149019004701181616534570,
29365                             -0.198076373431201528180486091412,
29366                             +0.455983776175066922272100478348 } };
29367 
29368 
29369     /* Spherical to Cartesian. */
29370        v1 = jauS2c(dl, db);
29371 
29372     /* Galactic to ICRS. */
29373        v2 = jauTrxp(r, v1);
29374 
29375     /* Cartesian to spherical. */
29376        SphericalCoordinate co = jauC2s(v2);
29377 
29378     /* Express in conventional ranges. */
29379        co.alpha = jauAnp(co.alpha);
29380        co.delta = jauAnpm(co.delta);
29381 
29382     /* Finished. */
29383       return co;
29384     }
29385  
29386     
29387     
29388     /**
29389     *  Transformation from ICRS to Galactic Coordinates.
29390     *
29391     *  This function is derived from the International Astronomical Union's
29392     *  SOFA (Standards of Fundamental Astronomy) software collection.
29393     *
29394     *  <p>Status:  support routine.
29395     *
29396     *     @param dr     double      ICRS right ascension (radians)
29397     *     @param dd     double      ICRS declination (radians)
29398     *
29399     *  @return co galactic longitude (radians), galactic latitude (radians)
29400     *
29401     *  <p>Notes:<ol>
29402     *
29403     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29404     *     respect to the now obsolete reference system FK4 B1950.0.  When
29405     *     interpreting the system in a modern context, several factors have
29406     *     to be taken into account:<ul>
29407     *
29408     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29409     *
29410     *     <li> The distortion of the FK4 proper motion system by differential
29411     *       Galactic rotation.
29412     *
29413     *     <li> The use of the B1950.0 equinox rather than the now-standard
29414     *       J2000.0.
29415     *
29416     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29417     *     </ul>
29418     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29419     *     matrix that transforms directly between ICRS and Galactic
29420     *     coordinates with the above factors taken into account.  The
29421     *     matrix is derived from three angles, namely the ICRS coordinates
29422     *     of the Galactic pole and the longitude of the ascending node of
29423     *     the galactic equator on the ICRS equator.  They are given in
29424     *     degrees to five decimal places and for canonical purposes are
29425     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29426     *     elements are given to 10 decimal places (about 20 microarcsec).
29427     *     In the present SOFA function the matrix elements have been
29428     *     recomputed from the canonical three angles and are given to 30
29429     *     decimal places.
29430     *
29431     *  <li> The inverse transformation is performed by the function iauG2icrs.
29432     *  </ol>
29433     *  Reference:
29434     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29435     *     catalogues.  Astrometric and photometric star catalogues
29436     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29437     *     Publications Division, Noordwijk, Netherlands.
29438     *
29439     *  @version   2015 January 20
29440     *
29441     *  @since JSOFA release 20150209
29442     *
29443     */
29444     public static SphericalCoordinate jauIcrs2g ( double dr, double dd )
29445     {
29446        double v1[], v2[];
29447 
29448     /*
29449     *  L2,B2 system of galactic coordinates in the form presented in the
29450     *  Hipparcos Catalogue.  In degrees:
29451     *
29452     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29453     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29454     *  R =  32.93192    longitude of the ascending node of the Galactic
29455     *                   plane on the ICRS equator
29456     *
29457     *  ICRS to galactic rotation matrix, obtained by computing
29458     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29459     */
29460        double r[][] = new double[][] { { -0.054875560416215368492398900454,
29461                             -0.873437090234885048760383168409,
29462                             -0.483835015548713226831774175116 },
29463                           { +0.494109427875583673525222371358,
29464                             -0.444829629960011178146614061616,
29465                             +0.746982244497218890527388004556 },
29466                           { -0.867666149019004701181616534570,
29467                             -0.198076373431201528180486091412,
29468                             +0.455983776175066922272100478348 } };
29469 
29470 
29471     /* Spherical to Cartesian. */
29472        v1 = jauS2c(dr, dd);
29473 
29474     /* ICRS to Galactic. */
29475        v2 = jauRxp(r, v1);
29476 
29477     /* Cartesian to spherical. */
29478        SphericalCoordinate co = jauC2s(v2);
29479 
29480     /* Express in conventional ranges. */
29481        co.alpha = jauAnp(co.alpha);
29482        co.delta = jauAnpm(co.delta);
29483        return co;
29484     }
29485 
29486 // 2016-05-03 additions below    
29487     
29488     /**
29489     *
29490     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29491     *  of date) to ICRS RA,Dec, using the IAU 2006 precession model.
29492     *
29493     * <p>This function is derived from the International Astronomical Union's
29494     *  SOFA (Standards of Fundamental Astronomy) software collection.
29495     *
29496     *  <p>Status:  support function.
29497     *
29498     *  <!-- Given: -->
29499     *     @param date1 double TT as a 2-part Julian date (Note 1)
29500     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29501     *     @param dl double ecliptic longitude and latitude (radians)
29502     *     @param db double ecliptic longitude and latitude (radians) 
29503     *
29504     * <!-- Returned: -->
29505     *     @return      double ICRS right ascension and declination (radians)
29506     *
29507     *<ol>
29508     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29509     *     convenient way between the two arguments.  For example,
29510     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29511     *     among others:
29512     *
29513     *            date1          date2
29514     *
29515     *         2450123.7           0.0       (JD method)
29516     *         2451545.0       -1421.3       (J2000 method)
29517     *         2400000.5       50123.2       (MJD method)
29518     *         2450123.5           0.2       (date &amp; time method)
29519     *
29520     *     The JD method is the most natural and convenient to use in
29521     *     cases where the loss of several decimal digits of resolution
29522     *     is acceptable.  The J2000 method is best matched to the way
29523     *     the argument is handled internally and will deliver the
29524     *     optimum resolution.  The MJD method and the date &amp; time methods
29525     *     are both good compromises between resolution and convenience.
29526     *
29527     *  <li> No assumptions are made about whether the coordinates represent
29528     *     starlight and embody astrometric effects such as parallax or
29529     *     aberration.
29530     *
29531     *  <li> The transformation is approximately that from ecliptic longitude
29532     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29533     *     right ascension and declination, with only frame bias (always
29534     *     less than 25 mas) to disturb this classical picture.
29535     *</ol>
29536     *  Called: <ul>
29537     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29538     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29539     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29540     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29541     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29542     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29543     *</ul>
29544     *
29545     *   @version  2016 February 9
29546     *
29547     *  @since JSOFA release 20160503
29548     *
29549     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29550     */
29551     public static SphericalCoordinate jauEceq06(double date1, double date2, double dl, double db)
29552     {
29553 
29554 
29555     /* Spherical to Cartesian. */
29556        double v1[] = jauS2c(dl, db);
29557 
29558     /* Rotation matrix, ICRS equatorial to ecliptic. */
29559        double rm[][] = jauEcm06(date1, date2);
29560 
29561     /* The transformation from ecliptic to ICRS. */
29562        double v2[] = jauTrxp(rm, v1);
29563 
29564     /* Cartesian to spherical. */
29565        SphericalCoordinate co = jauC2s(v2);
29566 
29567     /* Express in conventional ranges. */
29568        co.alpha = jauAnp(co.alpha);
29569        co.delta = jauAnpm(co.delta);
29570 
29571        return co;
29572     }
29573 
29574     /**
29575     *
29576     *  ICRS equatorial to ecliptic rotation matrix, IAU 2006.
29577     *
29578     * <p>This function is derived from the International Astronomical Union's
29579     *  SOFA (Standards of Fundamental Astronomy) software collection.
29580     *
29581     *  <p>Status:  support function.
29582     *
29583     *  <!-- Given: -->
29584     *    @param date1 double         TT as a 2-part Julian date (Note 1)
29585     *    @param date2 double         TT as a 2-part Julian date (Note 1) 
29586     *
29587     * <!-- Returned: -->
29588     *     @return          double[3][3]   ICRS to ecliptic rotation matrix
29589     *
29590     *  <p>Notes: <ol>
29591     *
29592     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29593     *     convenient way between the two arguments.  For example,
29594     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29595     *     among others:
29596     *
29597     *            date1          date2
29598     *
29599     *         2450123.7           0.0       (JD method)
29600     *         2451545.0       -1421.3       (J2000 method)
29601     *         2400000.5       50123.2       (MJD method)
29602     *         2450123.5           0.2       (date &amp; time method)
29603     *
29604     *     The JD method is the most natural and convenient to use in
29605     *     cases where the loss of several decimal digits of resolution
29606     *     is acceptable.  The J2000 method is best matched to the way
29607     *     the argument is handled internally and will deliver the
29608     *     optimum resolution.  The MJD method and the date &amp; time methods
29609     *     are both good compromises between resolution and convenience.
29610     *
29611     *  <li> The matrix is in the sense
29612     *
29613     *        E_ep = rm x P_ICRS,
29614     *
29615     *     where P_ICRS is a vector with respect to ICRS right ascension
29616     *     and declination axes and E_ep is the same vector with respect to
29617     *     the (inertial) ecliptic and equinox of date.
29618     *
29619     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
29620     *     magnitude, and not bound to any particular spatial origin, such
29621     *     as the Earth, Sun or SSB.  No assumptions are made about whether
29622     *     it represents starlight and embodies astrometric effects such as
29623     *     parallax or aberration.  The transformation is approximately that
29624     *     between mean J2000.0 right ascension and declination and ecliptic
29625     *     longitude and latitude, with only frame bias (always less than
29626     *     25 mas) to disturb this classical picture.
29627     *  </ol>
29628     *  Called: <ul>
29629     *     <li>{@link #jauObl06}     mean obliquity, IAU 2006
29630     *     <li>{@link #jauPmat06}    PB matrix, IAU 2006
29631     *     <li>{@link #jauIr}        initialize r-matrix to identity
29632     *     <li>{@link #jauRx}        rotate around X-axis
29633     *     <li>{@link #jauRxr}       product of two r-matrices
29634     *</ul>
29635     *
29636     *   @version  2015 December 11
29637     *
29638     *  @since JSOFA release 20160503
29639     *
29640     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29641     */
29642     public static double[][] jauEcm06(double date1, double date2)
29643     {
29644        double ob, e[][] = new double[3][3];
29645 
29646 
29647     /* Obliquity, IAU 2006. */
29648        ob = jauObl06(date1, date2);
29649 
29650     /* Precession-bias matrix, IAU 2006. */
29651        double bp[][] = jauPmat06(date1, date2);
29652 
29653     /* Equatorial of date to ecliptic matrix. */
29654        jauIr(e);
29655        jauRx(ob, e);
29656 
29657     /* ICRS to ecliptic coordinates rotation matrix, IAU 2006. */
29658        return jauRxr(e, bp);
29659 
29660     }
29661 
29662     /**
29663     *
29664     *  Transformation from ICRS equatorial coordinates to ecliptic
29665     *  coordinates (mean equinox and ecliptic of date) using IAU 2006
29666     *  precession model.
29667     *
29668     * <p>This function is derived from the International Astronomical Union's
29669     *  SOFA (Standards of Fundamental Astronomy) software collection.
29670     *
29671     *  <p>Status:  support function.
29672     *
29673     *  <!-- Given: -->
29674     *     @param date1 double TT as a 2-part Julian date (Note 1)
29675     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29676     *     @param dr double ICRS right ascension and declination (radians)
29677     *     @param dd double ICRS right ascension and declination (radians) 
29678     *
29679     * <!-- Returned: -->
29680     *     @return      double ecliptic longitude and latitude (radians)
29681     *<ol>
29682     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29683     *     convenient way between the two arguments.  For example,
29684     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29685     *     among others:
29686     *
29687     *            date1          date2
29688     *
29689     *         2450123.7           0.0       (JD method)
29690     *         2451545.0       -1421.3       (J2000 method)
29691     *         2400000.5       50123.2       (MJD method)
29692     *         2450123.5           0.2       (date &amp; time method)
29693     *
29694     *     The JD method is the most natural and convenient to use in
29695     *     cases where the loss of several decimal digits of resolution
29696     *     is acceptable.  The J2000 method is best matched to the way
29697     *     the argument is handled internally and will deliver the
29698     *     optimum resolution.  The MJD method and the date &amp; time methods
29699     *     are both good compromises between resolution and convenience.
29700     *
29701     *  <li> No assumptions are made about whether the coordinates represent
29702     *     starlight and embody astrometric effects such as parallax or
29703     *     aberration.
29704     *
29705     *  <li> The transformation is approximately that from mean J2000.0 right
29706     *     ascension and declination to ecliptic longitude and latitude
29707     *     (mean equinox and ecliptic of date), with only frame bias (always
29708     *     less than 25 mas) to disturb this classical picture.
29709     *</ol>
29710     *  Called:<ul>
29711     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29712     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29713     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
29714     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29715     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29716     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29717     *</ul>
29718     *   @version  2016 February 9
29719     *
29720     *  @since JSOFA release 20160503
29721     *
29722     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29723     */
29724     public static SphericalCoordinate jauEqec06(double date1, double date2, double dr, double dd)
29725     {
29726 
29727     /* Spherical to Cartesian. */
29728       double v1[] = jauS2c(dr, dd);
29729 
29730     /* Rotation matrix, ICRS equatorial to ecliptic. */
29731       double rm[][] = jauEcm06(date1, date2);
29732 
29733     /* The transformation from ICRS to ecliptic. */
29734        double v2[] = jauRxp(rm, v1);
29735 
29736     /* Cartesian to spherical. */
29737        SphericalCoordinate co = jauC2s(v2);
29738 
29739     /* Express in conventional ranges. */
29740        co.alpha = jauAnp(co.alpha);
29741        co.delta = jauAnpm(co.delta);
29742        return co;
29743 
29744     }
29745 
29746     /**
29747     *
29748     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29749     *  of date) to ICRS RA,Dec, using a long-term precession model.
29750     *
29751     * <p>This function is derived from the International Astronomical Union's
29752     *  SOFA (Standards of Fundamental Astronomy) software collection.
29753     *
29754     *  <p>Status:  support function.
29755     *
29756     *  <!-- Given: -->
29757     *    @param  epj     double     Julian epoch (TT)
29758     *    @param dl double     ecliptic longitude and latitude (radians)
29759     *    @param db double     ecliptic longitude and latitude (radians) 
29760     *
29761     * <!-- Returned: -->
29762     *     @return   double     ICRS right ascension and declination (radians)
29763     *<ol>
29764     *  <li> No assumptions are made about whether the coordinates represent
29765     *     starlight and embody astrometric effects such as parallax or
29766     *     aberration.
29767     *
29768     *  <li> The transformation is approximately that from ecliptic longitude
29769     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29770     *     right ascension and declination, with only frame bias (always
29771     *     less than 25 mas) to disturb this classical picture.
29772     *
29773     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29774     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29775     *     100 microarcseconds during the 20th and 21st centuries.  It is
29776     *     accurate to a few arcseconds throughout the historical period,
29777     *     worsening to a few tenths of a degree at the end of the
29778     *     +/- 200,000 year time span.
29779     *</ol>
29780     *  Called:<ul>
29781     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29782     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
29783     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29784     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29785     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29786     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29787     *</ul>
29788     *  References: <ul>
29789     *
29790     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29791     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29792     *    A22
29793     *
29794     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29795     *    expressions, valid for long time intervals (Corrigendum),
29796     *    Astron.Astrophys. 541, C1
29797     *</ul>
29798     *   @version  2016 February 9
29799     *
29800     *  @since JSOFA release 20160503
29801     *
29802     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29803     */
29804     public static SphericalCoordinate jauLteceq(double epj, double dl, double db)
29805     {
29806 
29807     /* Spherical to Cartesian. */
29808        double v1[] = jauS2c(dl, db);
29809 
29810     /* Rotation matrix, ICRS equatorial to ecliptic. */
29811        double rm[][] = jauLtecm(epj);
29812 
29813     /* The transformation from ecliptic to ICRS. */
29814        double v2[] = jauTrxp(rm, v1);
29815 
29816     /* Cartesian to spherical. */
29817        SphericalCoordinate co = jauC2s(v2);
29818 
29819     /* Express in conventional ranges. */
29820        co.alpha = jauAnp(co.alpha);
29821        co.delta = jauAnpm(co.delta);
29822        return co;
29823 
29824     }
29825 
29826     /**
29827     *
29828     *  ICRS equatorial to ecliptic rotation matrix, long-term.
29829     *
29830     * <p>This function is derived from the International Astronomical Union's
29831     *  SOFA (Standards of Fundamental Astronomy) software collection.
29832     *
29833     *  <p>Status:  support function.
29834     *
29835     *  <!-- Given: -->
29836     *     @param epj     double         Julian epoch (TT)
29837     *
29838     * <!-- Returned: -->
29839     *     @return      double[3][3]   ICRS to ecliptic rotation matrix
29840     *
29841     *  <p>Notes: <ol>
29842     *
29843     *  <li> The matrix is in the sense
29844     *
29845     *        E_ep = rm x P_ICRS,
29846     *
29847     *     where P_ICRS is a vector with respect to ICRS right ascension
29848     *     and declination axes and E_ep is the same vector with respect to
29849     *     the (inertial) ecliptic and equinox of epoch epj.
29850     *
29851     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
29852     *     magnitude, and not bound to any particular spatial origin, such
29853     *     as the Earth, Sun or SSB.  No assumptions are made about whether
29854     *     it represents starlight and embodies astrometric effects such as
29855     *     parallax or aberration.  The transformation is approximately that
29856     *     between mean J2000.0 right ascension and declination and ecliptic
29857     *     longitude and latitude, with only frame bias (always less than
29858     *     25 mas) to disturb this classical picture.
29859     *
29860     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29861     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29862     *     100 microarcseconds during the 20th and 21st centuries.  It is
29863     *     accurate to a few arcseconds throughout the historical period,
29864     *     worsening to a few tenths of a degree at the end of the
29865     *     +/- 200,000 year time span.
29866     *</ol>
29867     *  Called:<ul>
29868     *     <li>{@link #jauLtpequ}    equator pole, long term
29869     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
29870     *     <li>{@link #jauPxp}       vector product
29871     *     <li>{@link #jauPn}        normalize vector
29872     *</ul>
29873     *  References:<ul>
29874     *
29875     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29876     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29877     *    A22
29878     *
29879     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29880     *    expressions, valid for long time intervals (Corrigendum),
29881     *    Astron.Astrophys. 541, C1
29882     *</ul>
29883     *   @version  2015 December 6
29884     *
29885     *  @since JSOFA release 20160503
29886     *
29887     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29888     */
29889     public static double[][] jauLtecm(double epj)
29890     {
29891        double rm[][] = new double[3][3];
29892     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
29893        final double dx = -0.016617 * DAS2R,
29894                     de = -0.0068192 * DAS2R,
29895                     dr = -0.0146 * DAS2R;
29896 
29897 
29898     /* Equator pole. */
29899        double p[] = jauLtpequ(epj);
29900 
29901     /* Ecliptic pole (bottom row of equatorial to ecliptic matrix). */
29902        double z[] = jauLtpecl(epj);
29903 
29904     /* Equinox (top row of matrix). */
29905        double w[] = jauPxp(p, z);
29906        NormalizedVector nv = jauPn(w);
29907 
29908        double x[] = nv.u;
29909     /* Middle row of matrix. */
29910        double y[] = jauPxp(z, x);
29911 
29912     /* Combine with frame bias. */
29913        rm[0][0] =   x[0]    - x[1]*dr + x[2]*dx;
29914        rm[0][1] =   x[0]*dr + x[1]    + x[2]*de;
29915        rm[0][2] = - x[0]*dx - x[1]*de + x[2];
29916        rm[1][0] =   y[0]    - y[1]*dr + y[2]*dx;
29917        rm[1][1] =   y[0]*dr + y[1]    + y[2]*de;
29918        rm[1][2] = - y[0]*dx - y[1]*de + y[2];
29919        rm[2][0] =   z[0]    - z[1]*dr + z[2]*dx;
29920        rm[2][1] =   z[0]*dr + z[1]    + z[2]*de;
29921        rm[2][2] = - z[0]*dx - z[1]*de + z[2];
29922 
29923        return rm;
29924 
29925     }
29926 
29927     /**
29928     *
29929     *  Transformation from ICRS equatorial coordinates to ecliptic
29930     *  coordinates (mean equinox and ecliptic of date) using a long-term
29931     *  precession model.
29932     *
29933     * <p>This function is derived from the International Astronomical Union's
29934     *  SOFA (Standards of Fundamental Astronomy) software collection.
29935     *
29936     *  <p>Status:  support function.
29937     *
29938     *  <!-- Given: -->
29939     *     @param epj     double     Julian epoch (TT)
29940     *     @param dr   double     ICRS right ascension and declination (radians)
29941     *     @param dd   double     ICRS right ascension and declination (radians)
29942     *
29943     * <!-- Returned: -->
29944     *     @return     ecliptic longitude and latitude (radians)
29945     *<ol>
29946     *  <li> No assumptions are made about whether the coordinates represent
29947     *     starlight and embody astrometric effects such as parallax or
29948     *     aberration.
29949     *
29950     *  <li> The transformation is approximately that from mean J2000.0 right
29951     *     ascension and declination to ecliptic longitude and latitude
29952     *     (mean equinox and ecliptic of date), with only frame bias (always
29953     *     less than 25 mas) to disturb this classical picture.
29954     *
29955     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29956     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29957     *     100 microarcseconds during the 20th and 21st centuries.  It is
29958     *     accurate to a few arcseconds throughout the historical period,
29959     *     worsening to a few tenths of a degree at the end of the
29960     *     +/- 200,000 year time span.
29961     *</ol>
29962     *  Called:<ul>
29963     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29964     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
29965     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
29966     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29967     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29968     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29969     *</ul>
29970     *  References:
29971     *
29972     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29973     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29974     *    A22
29975     *
29976     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29977     *    expressions, valid for long time intervals (Corrigendum),
29978     *    Astron.Astrophys. 541, C1
29979     *
29980     *   @version  2016 February 9
29981     *
29982     *  @since JSOFA release 20160503
29983     *
29984     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29985     */
29986     public static SphericalCoordinate jauLteqec(double epj, double dr, double dd)
29987     {
29988 
29989     /* Spherical to Cartesian. */
29990        double v1[] = jauS2c(dr, dd);
29991 
29992     /* Rotation matrix, ICRS equatorial to ecliptic. */
29993        double rm[][] = jauLtecm(epj);
29994 
29995     /* The transformation from ICRS to ecliptic. */
29996        double v2[] = jauRxp(rm, v1);
29997 
29998     /* Cartesian to spherical. */
29999        SphericalCoordinate co = jauC2s(v2);
30000 
30001     /* Express in conventional ranges. */
30002       co.alpha = jauAnp(co.alpha);
30003       co.delta = jauAnpm(co.delta);
30004 
30005      return co;
30006     }
30007 
30008     /**
30009     *
30010     *  Long-term precession matrix.
30011     *
30012     * <p>This function is derived from the International Astronomical Union's
30013     *  SOFA (Standards of Fundamental Astronomy) software collection.
30014     *
30015     *  <p>Status:  support function.
30016     *
30017     *  <!-- Given: -->
30018     *     @param epj     double         Julian epoch (TT)
30019     *
30020     * <!-- Returned: -->
30021     *     @return      double[3][3]   precession matrix, J2000.0 to date
30022     *
30023     *  <p>Notes: <ol>
30024     *
30025     *  <li> The matrix is in the sense
30026     *
30027     *        P_date = rp x P_J2000,
30028     *
30029     *     where P_J2000 is a vector with respect to the J2000.0 mean
30030     *     equator and equinox and P_date is the same vector with respect to
30031     *     the equator and equinox of epoch epj.
30032     *
30033     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30034     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30035     *     100 microarcseconds during the 20th and 21st centuries.  It is
30036     *     accurate to a few arcseconds throughout the historical period,
30037     *     worsening to a few tenths of a degree at the end of the
30038     *     +/- 200,000 year time span.
30039     *</ol>
30040     *  Called:<ul>
30041     *     <li>{@link #jauLtpequ}    equator pole, long term
30042     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
30043     *     <li>{@link #jauPxp}       vector product
30044     *     <li>{@link #jauPn}        normalize vector
30045     *</ul>
30046     *  References:
30047     *
30048     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30049     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30050     *    A22
30051     *
30052     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30053     *    expressions, valid for long time intervals (Corrigendum),
30054     *    Astron.Astrophys. 541, C1
30055     *
30056     *   @version  2015 December 6
30057     *
30058     *  @since JSOFA release 20160503
30059     *
30060     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30061     */
30062     public static double[][] jauLtp(double epj )
30063     {
30064        double rp[][] = new double[3][3];
30065        int i;
30066        
30067 
30068 
30069     /* Equator pole (bottom row of matrix). */
30070        double peqr[] = jauLtpequ(epj);
30071 
30072     /* Ecliptic pole. */
30073        double pecl[] = jauLtpecl(epj);
30074 
30075     /* Equinox (top row of matrix). */
30076        double v[] = jauPxp(peqr, pecl);
30077        NormalizedVector nv = jauPn(v);
30078 
30079     /* Middle row of matrix. */
30080        v = jauPxp(peqr, nv.u);
30081 
30082     /* Assemble the matrix. */
30083        for ( i = 0; i < 3; i++ ) {
30084           rp[0][i] = nv.u[i];
30085           rp[1][i] = v[i];
30086           rp[2][i] = peqr[i];
30087        }
30088 
30089        return rp;
30090     }
30091 
30092 
30093     /**
30094     *
30095     *  Long-term precession matrix, including ICRS frame bias.
30096     *
30097     * <p>This function is derived from the International Astronomical Union's
30098     *  SOFA (Standards of Fundamental Astronomy) software collection.
30099     *
30100     *  <p>Status:  support function.
30101     *
30102     *  <!-- Given: -->
30103     *     @param epj     double         Julian epoch (TT)
30104     *
30105     * <!-- Returned: -->
30106     *     @return     double[3][3]   precession-bias matrix, J2000.0 to date
30107     *
30108     *  <p>Notes: <ol>
30109     *
30110     *  <li> The matrix is in the sense
30111     *
30112     *        P_date = rpb x P_ICRS,
30113     *
30114     *     where P_ICRS is a vector in the Geocentric Celestial Reference
30115     *     System, and P_date is the vector with respect to the Celestial
30116     *     Intermediate Reference System at that date but with nutation
30117     *     neglected.
30118     *
30119     *  <li> A first order frame bias formulation is used, of sub-
30120     *     microarcsecond accuracy compared with a full 3D rotation.
30121     *
30122     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30123     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30124     *     100 microarcseconds during the 20th and 21st centuries.  It is
30125     *     accurate to a few arcseconds throughout the historical period,
30126     *     worsening to a few tenths of a degree at the end of the
30127     *     +/- 200,000 year time span.
30128     *</ol>
30129     *  References:
30130     *
30131     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30132     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30133     *    A22
30134     *
30135     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30136     *    expressions, valid for long time intervals (Corrigendum),
30137     *    Astron.Astrophys. 541, C1
30138     *
30139     *   @version  2015 December 6
30140     *
30141     *  @since JSOFA release 20160503
30142     *
30143     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30144     */
30145     public static double[][] jauLtpb(double epj)
30146     {
30147         double rpb[][] = new double[3][3];
30148     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
30149        final double dx = -0.016617 * DAS2R,
30150                     de = -0.0068192 * DAS2R,
30151                     dr = -0.0146 * DAS2R;
30152 
30153        int i;
30154       
30155 
30156 
30157     /* Precession matrix. */
30158         double rp[][] = jauLtp(epj);
30159 
30160     /* Apply the bias. */
30161        for ( i = 0; i < 3; i++ ) {
30162           rpb[i][0] =  rp[i][0]    - rp[i][1]*dr + rp[i][2]*dx;
30163           rpb[i][1] =  rp[i][0]*dr + rp[i][1]    + rp[i][2]*de;
30164           rpb[i][2] = -rp[i][0]*dx - rp[i][1]*de + rp[i][2];
30165        }
30166 
30167       return rpb;
30168     }
30169 
30170     /**
30171     *
30172     *  Long-term precession of the ecliptic.
30173     *
30174     * <p>This function is derived from the International Astronomical Union's
30175     *  SOFA (Standards of Fundamental Astronomy) software collection.
30176     *
30177     *  <p>Status:  support function.
30178     *
30179     *  <!-- Given: -->
30180     *     @param epj     double         Julian epoch (TT)
30181     *
30182     * <!-- Returned: -->
30183     *     @return     double[3]      ecliptic pole unit vector
30184     *
30185     *  <p>Notes: <ol>
30186     *
30187     *  <li> The returned vector is with respect to the J2000.0 mean equator
30188     *     and equinox.
30189     *
30190     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30191     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30192     *     100 microarcseconds during the 20th and 21st centuries.  It is
30193     *     accurate to a few arcseconds throughout the historical period,
30194     *     worsening to a few tenths of a degree at the end of the
30195     *     +/- 200,000 year time span.
30196     *</ol>
30197     *  References:
30198     *
30199     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30200     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30201     *    A22
30202     *
30203     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30204     *    expressions, valid for long time intervals (Corrigendum),
30205     *    Astron.Astrophys. 541, C1
30206     *
30207     *   @version  2016 February 9
30208     *
30209     *  @since JSOFA release 20160503
30210     *
30211     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30212     */
30213     public static double[] jauLtpecl(double epj)
30214     {
30215         
30216        double vec[] = new double[3];
30217     /* Obliquity at J2000.0 (radians). */
30218        final double eps0 = 84381.406 * DAS2R;
30219 
30220     /* Polynomial coefficients */
30221         final int NPOL = 4 ;
30222         final double pqpol[][] = {
30223           { 5851.607687,
30224               -0.1189000,
30225               -0.00028913,
30226                0.000000101},
30227           {-1600.886300,
30228                1.1689818,
30229               -0.00000020,
30230               -0.000000437}
30231        };
30232 
30233     /* Periodic coefficients */
30234        final double pqper[][] = {
30235           { 708.15,-5486.751211,-684.661560,  667.666730,-5523.863691},
30236           {2309.00,  -17.127623,2446.283880,-2354.886252, -549.747450},
30237           {1620.00, -617.517403, 399.671049, -428.152441, -310.998056},
30238           { 492.20,  413.442940,-356.652376,  376.202861,  421.535876},
30239           {1183.00,   78.614193,-186.387003,  184.778874,  -36.776172},
30240           { 622.00, -180.732815,-316.800070,  335.321713, -145.278396},
30241           { 882.00,  -87.676083, 198.296701, -185.138669,  -34.744450},
30242           { 547.00,   46.140315, 101.135679, -120.972830,   22.885731}
30243        };
30244        final int NPER = pqper.length;
30245 
30246     /* Miscellaneous */
30247        int i;
30248        double t, p, q, w, a, s, c;
30249 
30250 
30251     /* Centuries since J2000. */
30252        t  = ( epj - 2000.0 ) / 100.0;
30253 
30254     /* Initialize P_A and Q_A accumulators. */
30255        p = 0.0;
30256        q = 0.0;
30257 
30258     /* Periodic terms. */
30259        w = D2PI*t;
30260        for ( i = 0; i < NPER; i++ ) {
30261           a = w/pqper[i][0];
30262           s = sin(a);
30263           c = cos(a);
30264           p += c*pqper[i][1] + s*pqper[i][3];
30265           q += c*pqper[i][2] + s*pqper[i][4];
30266        }
30267 
30268     /* Polynomial terms. */
30269        w = 1.0;
30270        for ( i = 0; i < NPOL; i++ ) {
30271           p += pqpol[0][i]*w;
30272           q += pqpol[1][i]*w;
30273           w *= t;
30274        }
30275 
30276     /* P_A and Q_A (radians). */
30277        p *= DAS2R;
30278        q *= DAS2R;
30279 
30280     /* Form the ecliptic pole vector. */
30281        w = 1.0 - p*p - q*q;
30282        w = w < 0.0 ? 0.0 : sqrt(w);
30283        s = sin(eps0);
30284        c = cos(eps0);
30285        vec[0] = p;
30286        vec[1] = - q*c - w*s;
30287        vec[2] = - q*s + w*c;
30288 
30289        return vec;
30290 
30291     }
30292 
30293     /**
30294     *
30295     *  Long-term precession of the equator.
30296     *
30297     * <p>This function is derived from the International Astronomical Union's
30298     *  SOFA (Standards of Fundamental Astronomy) software collection.
30299     *
30300     *  <p>Status:  support function.
30301     *
30302     *  <!-- Given: -->
30303     *     @param epj     double         Julian epoch (TT)
30304     *
30305     * <!-- Returned: -->
30306     *     @return     double[3]      equator pole unit vector
30307     *
30308     *  <p>Notes: <ol>
30309     *
30310     *  <li> The returned vector is with respect to the J2000.0 mean equator
30311     *     and equinox.
30312     *
30313     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30314     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30315     *     100 microarcseconds during the 20th and 21st centuries.  It is
30316     *     accurate to a few arcseconds throughout the historical period,
30317     *     worsening to a few tenths of a degree at the end of the
30318     *     +/- 200,000 year time span.
30319     *</ol>
30320     *  References:
30321     *
30322     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30323     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30324     *    A22
30325     *
30326     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30327     *    expressions, valid for long time intervals (Corrigendum),
30328     *    Astron.Astrophys. 541, C1
30329     *
30330     *   @version  2016 February 9
30331     *
30332     *  @since JSOFA release 20160503
30333     *
30334     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30335     */
30336     public static double[] jauLtpequ(double epj)
30337     {
30338         double veq[] = new double[3];
30339     /* Polynomial coefficients */
30340        final int NPOL = 4;
30341        final double xypol[][] = {
30342           {  5453.282155,
30343                 0.4252841,
30344                -0.00037173,
30345                -0.000000152},
30346           {-73750.930350,
30347                -0.7675452,
30348                -0.00018725,
30349                 0.000000231}
30350        };
30351 
30352     /* Periodic coefficients */
30353         final double xyper[][] = {
30354           { 256.75, -819.940624,75004.344875,81491.287984, 1558.515853},
30355           { 708.15,-8444.676815,  624.033993,  787.163481, 7774.939698},
30356           { 274.20, 2600.009459, 1251.136893, 1251.296102,-2219.534038},
30357           { 241.45, 2755.175630,-1102.212834,-1257.950837,-2523.969396},
30358           {2309.00, -167.659835,-2660.664980,-2966.799730,  247.850422},
30359           { 492.20,  871.855056,  699.291817,  639.744522, -846.485643},
30360           { 396.10,   44.769698,  153.167220,  131.600209,-1393.124055},
30361           { 288.90, -512.313065, -950.865637, -445.040117,  368.526116},
30362           { 231.10, -819.415595,  499.754645,  584.522874,  749.045012},
30363           {1610.00, -538.071099, -145.188210,  -89.756563,  444.704518},
30364           { 620.00, -189.793622,  558.116553,  524.429630,  235.934465},
30365           { 157.87, -402.922932,  -23.923029,  -13.549067,  374.049623},
30366           { 220.30,  179.516345, -165.405086, -210.157124, -171.330180},
30367           {1200.00,   -9.814756,    9.344131,  -44.919798,  -22.899655}
30368        };
30369        final int NPER = xyper.length;
30370 
30371     /* Miscellaneous */
30372        int i;
30373        double t, x, y, w, a, s, c;
30374 
30375 
30376     /* Centuries since J2000. */
30377        t  = ( epj - 2000.0 ) / 100.0;
30378 
30379     /* Initialize X and Y accumulators. */
30380        x = 0.0;
30381        y = 0.0;
30382 
30383     /* Periodic terms. */
30384        w = D2PI * t;
30385        for ( i = 0; i < NPER; i++ ) {
30386           a = w / xyper[i][0];
30387           s = sin(a);
30388           c = cos(a);
30389           x += c*xyper[i][1] + s*xyper[i][3];
30390           y += c*xyper[i][2] + s*xyper[i][4];
30391        }
30392 
30393     /* Polynomial terms. */
30394        w = 1.0;
30395        for ( i = 0; i < NPOL; i++ ) {
30396           x += xypol[0][i]*w;
30397           y += xypol[1][i]*w;
30398           w *= t;
30399        }
30400 
30401     /* X and Y (direction cosines). */
30402        x *= DAS2R;
30403        y *= DAS2R;
30404 
30405     /* Form the equator pole vector. */
30406        veq[0] = x;
30407        veq[1] = y;
30408        w = 1.0 - x*x - y*y;
30409        veq[2] = w < 0.0 ? 0.0 : sqrt(w);
30410 
30411        
30412        return veq;
30413 
30414     }
30415 
30416     /**
30417      * Position consisting of (ha, declination) pairs in radians. Where ha is hour angle and dec is declination .
30418      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
30419      * 
30420      * @since JSOFA release 20180130
30421      */
30422     public static class EquatorialCoordinate {
30423         public double ha;
30424         public double dec;
30425         public EquatorialCoordinate(double ha, double dec){
30426             this.ha = ha;
30427             this.dec = dec;
30428         }
30429     }
30430 
30431     /**
30432      *
30433      *  Horizon to equatorial coordinates:  transform azimuth and altitude
30434      *  to hour angle and declination.
30435      *
30436      * <!-- Given: -->
30437      *  @param  az       double       azimuth
30438      *  @param  el       double       altitude (informally, elevation)
30439      *  @param  phi      double       site latitude
30440      *
30441      * <!-- Returned: -->
30442      *  @return   ha       double       hour angle (local)
30443      *     dec      double       declination
30444      *
30445      * <p>Notes: <ol>
30446      *
30447      * <li>  All the arguments are angles in radians.
30448      *
30449      * <li>  The sign convention for azimuth is north zero, east +pi/2.
30450      *
30451      * <li>  HA is returned in the range +/-pi.  Declination is returned in
30452      *      the range +/-pi/2.
30453      *
30454      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30455      *      rotation axis and the adopted zenith.  In many applications it
30456      *      will be sufficient to use the published geodetic latitude of the
30457      *      site.  In very precise (sub-arcsecond) applications, phi can be
30458      *      corrected for polar motion.
30459      *
30460      * <li>  The azimuth az must be with respect to the rotational north pole,
30461      *      as opposed to the ITRS pole, and an azimuth with respect to north
30462      *      on a map of the Earth's surface will need to be adjusted for
30463      *      polar motion if sub-arcsecond accuracy is required.
30464      *
30465      * <li>  Should the user wish to work with respect to the astronomical
30466      *      zenith rather than the geodetic zenith, phi will need to be
30467      *      adjusted for deflection of the vertical (often tens of
30468      *      arcseconds), and the zero point of ha will also be affected.
30469      *
30470      * <li>  The transformation is the same as Ve = Ry(phi-pi/2)*Rz(pi)*Vh,
30471      *      where Ve and Vh are lefthanded unit vectors in the (ha,dec) and
30472      *      (az,el) systems respectively and Rz and Ry are rotations about
30473      *      first the z-axis and then the y-axis.  (n.b. Rz(pi) simply
30474      *      reverses the signs of the x and y components.)  For efficiency,
30475      *      the algorithm is written out rather than calling other utility
30476      *      functions.  For applications that require even greater
30477      *      efficiency, additional savings are possible if constant terms
30478      *      such as functions of latitude are computed once and for all.
30479      *
30480      * <li>  Again for efficiency, no range checking of arguments is carried
30481      *      out.
30482      *</ol>
30483      *  Last revision:   2017 September 12
30484      *
30485      * @since JSOFA release 20180130
30486      *
30487      */
30488 
30489     public static  EquatorialCoordinate jauAe2hd (double az, double el, double phi)
30490     {
30491         double sa, ca, se, ce, sp, cp, x, y, z, r;
30492 
30493 
30494         /* Useful trig functions. */
30495         sa = sin(az);
30496         ca = cos(az);
30497         se = sin(el);
30498         ce = cos(el);
30499         sp = sin(phi);
30500         cp = cos(phi);
30501 
30502         /* HA,Dec unit vector. */
30503         x = - ca*ce*sp + se*cp;
30504         y = - sa*ce;
30505         z = ca*ce*cp + se*sp;
30506 
30507         /* To spherical. */
30508         r = sqrt(x*x + y*y);
30509         return new EquatorialCoordinate( (r != 0.0) ? atan2(y,x) : 0.0,
30510                 atan2(z,r));
30511 
30512         /* Finished. */
30513     }
30514 
30515 
30516     /**
30517      * Position consisting of (az, el) pairs in radians. Where az is the azimuth and el is elevation .
30518      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30519      * 
30520      * @since JSOFA release 20180130
30521      */
30522     public static class HorizonCoordinate {
30523         public double az;
30524         public double el;
30525         public HorizonCoordinate(double az, double el){
30526             this.az = az;
30527             this.el = el;
30528         }
30529     }
30530 
30531 
30532     /**
30533      *
30534      *  Equatorial to horizon coordinates:  transform hour angle and
30535      *  declination to azimuth and altitude.
30536      *
30537      *  <p>This function is derived from the International Astronomical Union's
30538      *  SOFA (Standards of Fundamental Astronomy) software collection.
30539      *
30540      *  <p>Status:  support function.
30541      *
30542      * <!-- Given: -->
30543      *  @param   ha       double       hour angle (local)
30544      *  @param   dec      double       declination
30545      *  @param   phi      double       site latitude
30546      *
30547      * <!-- Returned: -->
30548      *  @return   az      double       azimuth
30549      *     el      double       altitude (informally, elevation)
30550      *
30551      * <p>Notes: <ol>
30552      *
30553      * <li>  All the arguments are angles in radians.
30554      *
30555      * <li>  Azimuth is returned in the range 0-2pi;  north is zero, and east
30556      *      is +pi/2.  Altitude is returned in the range +/- pi/2.
30557      *
30558      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30559      *      rotation axis and the adopted zenith.  In many applications it
30560      *      will be sufficient to use the published geodetic latitude of the
30561      *      site.  In very precise (sub-arcsecond) applications, phi can be
30562      *      corrected for polar motion.
30563      *
30564      * <li>  The returned azimuth az is with respect to the rotational north
30565      *      pole, as opposed to the ITRS pole, and for sub-arcsecond
30566      *      accuracy will need to be adjusted for polar motion if it is to
30567      *      be with respect to north on a map of the Earth's surface.
30568      *
30569      * <li>  Should the user wish to work with respect to the astronomical
30570      *      zenith rather than the geodetic zenith, phi will need to be
30571      *      adjusted for deflection of the vertical (often tens of
30572      *      arcseconds), and the zero point of the hour angle ha will also
30573      *      be affected.
30574      *
30575      * <li>  The transformation is the same as Vh = Rz(pi)*Ry(pi/2-phi)*Ve,
30576      *      where Vh and Ve are lefthanded unit vectors in the (az,el) and
30577      *      (ha,dec) systems respectively and Ry and Rz are rotations about
30578      *      first the y-axis and then the z-axis.  (n.b. Rz(pi) simply
30579      *      reverses the signs of the x and y components.)  For efficiency,
30580      *      the algorithm is written out rather than calling other utility
30581      *      functions.  For applications that require even greater
30582      *      efficiency, additional savings are possible if constant terms
30583      *      such as functions of latitude are computed once and for all.
30584      *
30585      * <li>  Again for efficiency, no range checking of arguments is carried
30586      *      out.
30587      *</ol>
30588      *  Last revision:   2017 September 12
30589      *
30590      * @since JSOFA release 20180130
30591      *
30592      */
30593     public static HorizonCoordinate jauHd2ae (double ha, double dec, double phi)
30594     {
30595         double sh, ch, sd, cd, sp, cp, x, y, z, r, a;
30596 
30597 
30598         /* Useful trig functions. */
30599         sh = sin(ha);
30600         ch = cos(ha);
30601         sd = sin(dec);
30602         cd = cos(dec);
30603         sp = sin(phi);
30604         cp = cos(phi);
30605 
30606         /* Az,Alt unit vector. */
30607         x = - ch*cd*sp + sd*cp;
30608         y = - sh*cd;
30609         z = ch*cd*cp + sd*sp;
30610 
30611         /* To spherical. */
30612         r = sqrt(x*x + y*y);
30613         a = (r != 0.0) ? atan2(y,x) : 0.0;
30614         return new HorizonCoordinate((a < 0.0) ? a+D2PI : a,
30615                 atan2(z,r));
30616 
30617         /* Finished. */
30618     }
30619 
30620 
30621     /**
30622      *
30623      *  Parallactic angle for a given hour angle and declination.
30624      *
30625      *  <p>This function is derived from the International Astronomical Union's
30626      *  SOFA (Standards of Fundamental Astronomy) software collection.
30627      *
30628      *  <p>Status:  support function.
30629      *
30630      * <!-- Given: -->
30631      *  @param  ha     double     hour angle
30632      *  @param  dec    double     declination
30633      *  @param  phi    double     site latitude
30634      *
30635      *  @return     double     parallactic angle
30636      *
30637      * <p>Notes: <ol>
30638      *
30639      * <li>  All the arguments are angles in radians.
30640      *
30641      * <li>  The parallactic angle at a point in the sky is the position
30642      *      angle of the vertical, i.e. the angle between the directions to
30643      *      the north celestial pole and to the zenith respectively.
30644      *
30645      * <li>  The result is returned in the range -pi to +pi.
30646      *
30647      * <li>  At the pole itself a zero result is returned.
30648      *
30649      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30650      *      rotation axis and the adopted zenith.  In many applications it
30651      *      will be sufficient to use the published geodetic latitude of the
30652      *      site.  In very precise (sub-arcsecond) applications, phi can be
30653      *      corrected for polar motion.
30654      *
30655      * <li>  Should the user wish to work with respect to the astronomical
30656      *      zenith rather than the geodetic zenith, phi will need to be
30657      *      adjusted for deflection of the vertical (often tens of
30658      *      arcseconds), and the zero point of the hour angle ha will also
30659      *      be affected.
30660      *</ol>
30661      *  Reference:
30662      *     Smart, W.M., "Spherical Astronomy", Cambridge University Press,
30663      *     6th edition (Green, 1977), p49.
30664      *
30665      *  Last revision:   2017 September 12
30666      *
30667      * @since JSOFA release 20180130
30668      *
30669      */
30670     public static double jauHd2pa (double ha, double dec, double phi)
30671     {
30672         double cp, cqsz, sqsz;
30673 
30674 
30675         cp = cos(phi);
30676         sqsz = cp*sin(ha);
30677         cqsz = sin(phi)*cos(dec) - cp*sin(dec)*cos(ha);
30678         return ( ( sqsz != 0.0 || cqsz != 0.0 ) ? atan2(sqsz,cqsz) : 0.0 );
30679 
30680         /* Finished. */
30681     }
30682 
30683 
30684     /**
30685      * Tangent point soulutions. A class to contain tangent point soutions and an indication as to how many of the solutions are valid
30686      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30687      * @since JSOFA release 20180130
30688      */
30689     public static class TangentPointSolution
30690     {
30691         public SphericalCoordinate sol1;
30692         public SphericalCoordinate sol2;
30693 
30694         /** nsolutions. The number of useful solutions
30695          */
30696         public int nsolutions;
30697         /**
30698          * @param sol1
30699          * @param sol2
30700          * @param flag
30701          */
30702         public TangentPointSolution(SphericalCoordinate sol1,
30703                 SphericalCoordinate sol2, int flag) {
30704             this.sol1 = sol1;
30705             this.sol2 = sol2;
30706             this.nsolutions = flag;
30707         }
30708         public TangentPointSolution()
30709         {
30710             this.sol1 = null;
30711             this.sol2 = null;
30712             this.nsolutions = 0;
30713         }
30714     }
30715     /**
30716      *
30717      *  In the tangent plane projection, given the rectangular coordinates
30718      *  of a star and its spherical coordinates, determine the spherical
30719      *  coordinates of the tangent point.
30720      *
30721      *  <p>This function is derived from the International Astronomical Union's
30722      *  SOFA (Standards of Fundamental Astronomy) software collection.
30723      *
30724      *  <p>Status:  support function.
30725      *
30726      * <!-- Given: -->
30727      *   @param  xi     double  rectangular coordinates of star image (Note 2)
30728      *   @param  eta     double  rectangular coordinates of star image (Note 2)
30729      *   @param  a        double  star's spherical coordinates (Note 3)
30730      *   @param  b        double  star's spherical coordinates (Note 3)
30731      *
30732      * <!-- Returned: -->
30733      *     @return  tangent point's spherical coordinate solutions
30734      *
30735      *  Returned (function value):
30736      *                int     number of solutions:
30737      *                        0 = no solutions returned (Note 5)
30738      *                        1 = only the first solution is useful (Note 6)
30739      *                        2 = both solutions are useful (Note 6)
30740      *
30741      * <p>Notes: <ol>
30742      *
30743      * <li> The tangent plane projection is also called the "gnomonic
30744      *     projection" and the "central projection".
30745      *
30746      * <li> The eta axis points due north in the adopted coordinate system.
30747      *     If the spherical coordinates are observed (RA,Dec), the tangent
30748      *     plane coordinates (xi,eta) are conventionally called the
30749      *     "standard coordinates".  If the spherical coordinates are with
30750      *     respect to a right-handed triad, (xi,eta) are also right-handed.
30751      *     The units of (xi,eta) are, effectively, radians at the tangent
30752      *     point.
30753      *
30754      * <li> All angular arguments are in radians.
30755      *
30756      * <li> The angles a01 and a02 are returned in the range 0-2pi.  The
30757      *     angles b01 and b02 are returned in the range +/-pi, but in the
30758      *     usual, non-pole-crossing, case, the range is +/-pi/2.
30759      *
30760      * <li> Cases where there is no solution can arise only near the poles.
30761      *     For example, it is clearly impossible for a star at the pole
30762      *     itself to have a non-zero xi value, and hence it is meaningless
30763      *     to ask where the tangent point would have to be to bring about
30764      *     this combination of xi and dec.
30765      *
30766      * <li> Also near the poles, cases can arise where there are two useful
30767      *     solutions.  The return value indicates whether the second of the
30768      *     two solutions returned is useful;  1 indicates only one useful
30769      *     solution, the usual case.
30770      *
30771      * <li> The basis of the algorithm is to solve the spherical triangle PSC,
30772      *     where P is the north celestial pole, S is the star and C is the
30773      *     tangent point.  The spherical coordinates of the tangent point are
30774      *     [a0,b0];  writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), side c
30775      *     is then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
30776      *     found) is (pi/2-b0).  Angle C is given by sin(C) = xi/rho and
30777      *     cos(C) = eta/rho.  Angle P (to be found) is the longitude
30778      *     difference between star and tangent point (a-a0).
30779      *
30780      * <li> This function is a member of the following set:
30781      * <pre
30782      *{@code
30783      *         spherical      vector         solve for
30784      *
30785      *         iauTpxes      iauTpxev         xi,eta
30786      *         iauTpsts      iauTpstv          star
30787      *       > iauTpors <    iauTporv         origin
30788      *}
30789      *</ol>
30790      *  Called:
30791      *     iauAnp       normalize angle into range 0 to 2pi
30792      *
30793      *  References:
30794      *
30795      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
30796      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
30797      *
30798      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
30799      *     1987, Chapter 13.
30800      *
30801      * @version   2018 January 2
30802      *
30803      * @since JSOFA release 20180130
30804      *
30805      */
30806     public static TangentPointSolution jauTpors(double xi, double eta, double a, double b)
30807     {
30808         double xi2, r, sb, cb, rsb, rcb, w2, w, s, c;
30809         double a01, b01, a02, b02;
30810 
30811 
30812         xi2 = xi*xi;
30813         r = sqrt(1.0 + xi2 + eta*eta);
30814         sb = sin(b);
30815         cb = cos(b);
30816         rsb = r*sb;
30817         rcb = r*cb;
30818         w2 = rcb*rcb - xi2;
30819         if ( w2 >= 0.0 ) {
30820             w = sqrt(w2);
30821             s = rsb - eta*w;
30822             c = rsb*eta + w;
30823             if ( xi == 0.0 && w == 0.0 ) w = 1.0;
30824             a01 = jauAnp(a - atan2(xi,w));
30825             b01 = atan2(s,c);
30826             w = -w;
30827             s = rsb - eta*w;
30828             c = rsb*eta + w;
30829             a02 = jauAnp(a - atan2(xi,w));
30830             b02 = atan2(s,c);
30831             return new TangentPointSolution(new SphericalCoordinate(a01, b01), new SphericalCoordinate(a02, b02), 
30832                     (abs(rsb) < 1.0) ? 1 : 2);
30833         } else {
30834             return new TangentPointSolution();
30835         }
30836 
30837         /* Finished. */
30838 
30839     }
30840 
30841     /**
30842      * Tangent point soutions as direction cosines. A container class for two possible solutiuons as well as an indication of the number of valid solutions.
30843      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30844      * @since 27 Mar 2018
30845      */
30846     public static class TangentPointDirectionCosines {
30847         public double dc1[];
30848         public double dc2[];
30849         /** nsolution. number of valid solutions.
30850          */
30851         public int nsolution;
30852         /**
30853          * @param dc1 direction cosines 
30854          * @param dc2 direction cosines
30855          * @param nsolution number of valid solutions
30856          */
30857         public TangentPointDirectionCosines(double[] dc1, double[] dc2,
30858                 int nsolution) {
30859             this.dc1 = dc1;
30860             this.dc2 = dc2;
30861             this.nsolution = nsolution;
30862         }
30863         /**
30864          * 
30865          */
30866         public TangentPointDirectionCosines() {
30867             this.nsolution = 0;
30868         }
30869 
30870     }
30871     /**
30872      *
30873      *  In the tangent plane projection, given the rectangular coordinates
30874      *  of a star and its direction cosines, determine the direction
30875      *  cosines of the tangent point.
30876      *
30877      *  <p>This function is derived from the International Astronomical Union's
30878      *  SOFA (Standards of Fundamental Astronomy) software collection.
30879      *
30880      *  <p>Status:  support function.
30881      *
30882      * <!-- Given: -->
30883      *     @param xi   double    rectangular coordinates of star image (Note 2)
30884      *     @param eta     double    rectangular coordinates of star image (Note 2)
30885      *     @param v        double[3] star's direction cosines (Note 3)
30886      *
30887      * <!-- Returned: -->
30888      *     @return       tangent point's direction cosines, Solutions 1 &amp; 2 
30889      *                   int     number of solutions:
30890      *                        0 = no solutions returned (Note 4)
30891      *                        1 = only the first solution is useful (Note 5)
30892      *                        2 = both solutions are useful (Note 5)
30893      *
30894      * <p>Notes: <ol>
30895      *
30896      * <li> The tangent plane projection is also called the "gnomonic
30897      *     projection" and the "central projection".
30898      *
30899      * <li> The eta axis points due north in the adopted coordinate system.
30900      *     If the direction cosines represent observed (RA,Dec), the tangent
30901      *     plane coordinates (xi,eta) are conventionally called the
30902      *     "standard coordinates".  If the direction cosines are with
30903      *     respect to a right-handed triad, (xi,eta) are also right-handed.
30904      *     The units of (xi,eta) are, effectively, radians at the tangent
30905      *     point.
30906      *
30907      * <li> The vector v must be of unit length or the result will be wrong.
30908      *
30909      * <li> Cases where there is no solution can arise only near the poles.
30910      *     For example, it is clearly impossible for a star at the pole
30911      *     itself to have a non-zero xi value, and hence it is meaningless
30912      *     to ask where the tangent point would have to be.
30913      *
30914      * <li> Also near the poles, cases can arise where there are two useful
30915      *     solutions.  The return value indicates whether the second of the
30916      *     two solutions returned is useful;  1 indicates only one useful
30917      *     solution, the usual case.
30918      *
30919      * <li> The basis of the algorithm is to solve the spherical triangle
30920      *     PSC, where P is the north celestial pole, S is the star and C is
30921      *     the tangent point.  Calling the celestial spherical coordinates
30922      *     of the star and tangent point (a,b) and (a0,b0) respectively, and
30923      *     writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), and
30924      *     transforming the vector v into (a,b) in the normal way, side c is
30925      *     then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
30926      *     found) is (pi/2-b0), while angle C is given by sin(C) = xi/rho
30927      *     and cos(C) = eta/rho;  angle P (to be found) is (a-a0).  After
30928      *     solving the spherical triangle, the result (a0,b0) can be
30929      *     expressed in vector form as v0.
30930      *
30931      * <li> This function is a member of the following set:
30932      * {@code
30933      *         spherical      vector         solve for
30934      *
30935      *         iauTpxes      iauTpxev         xi,eta
30936      *         iauTpsts      iauTpstv          star
30937      *         iauTpors    > iauTporv <       origin
30938      * }
30939      *</ol>
30940      *  References:
30941      *
30942      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
30943      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
30944      *
30945      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
30946      *     1987, Chapter 13.
30947      *
30948      * @version   2018 January 2
30949      *
30950      * @since JSOFA release 20180130
30951      *
30952      */
30953 
30954     public static TangentPointDirectionCosines jauTporv(double xi, double eta, double v[])
30955     {
30956         double x, y, z, rxy2, xi2, eta2p1, r, rsb, rcb, w2, w, c;
30957         double v01[] = new double[3];
30958         double v02[] = new double[3];
30959 
30960         x = v[0];
30961         y = v[1];
30962         z = v[2];
30963         rxy2 = x*x + y*y;
30964         xi2 = xi*xi;
30965         eta2p1 = eta*eta + 1.0;
30966         r = sqrt(xi2 + eta2p1);
30967         rsb = r*z;
30968         rcb = r*sqrt(x*x + y*y);
30969         w2 = rcb*rcb - xi2;
30970         if ( w2 > 0.0 ) {
30971             w = sqrt(w2);
30972             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
30973             v01[0] = c * (x*w + y*xi);
30974             v01[1] = c * (y*w - x*xi);
30975             v01[2] = (rsb - eta*w) / eta2p1;
30976             w = - w;
30977             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
30978             v02[0] = c * (x*w + y*xi);
30979             v02[1] = c * (y*w - x*xi);
30980             v02[2] = (rsb - eta*w) / eta2p1;
30981             return new TangentPointDirectionCosines(v01,v02,(abs(rsb) < 1.0) ? 1 : 2);
30982         } else {
30983             return new TangentPointDirectionCosines();
30984         }
30985 
30986         /* Finished. */
30987     }
30988 
30989     /**
30990      *
30991      *  In the tangent plane projection, given the star's rectangular
30992      *  coordinates and the spherical coordinates of the tangent point,
30993      *  solve for the spherical coordinates of the star.
30994      *
30995      *  <p>This function is derived from the International Astronomical Union's
30996      *  SOFA (Standards of Fundamental Astronomy) software collection.
30997      *
30998      *  <p>Status:  support function.
30999      *
31000      * <!-- Given: -->
31001      *     @param xi    double  rectangular coordinates of star image (Note 2)
31002      *     @param eta    double  rectangular coordinates of star image (Note 2)
31003      *     @param a0     double  tangent point's spherical coordinates
31004      *     @param b0     double  tangent point's spherical coordinates
31005      *
31006      * <!-- Returned: -->
31007      *     @return     star's spherical coordinates
31008      *<ol>
31009      * <li> The tangent plane projection is also called the "gnomonic
31010      *     projection" and the "central projection".
31011      *
31012      * <li> The eta axis points due north in the adopted coordinate system.
31013      *     If the spherical coordinates are observed (RA,Dec), the tangent
31014      *     plane coordinates (xi,eta) are conventionally called the
31015      *     "standard coordinates".  If the spherical coordinates are with
31016      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31017      *     The units of (xi,eta) are, effectively, radians at the tangent
31018      *     point.
31019      *
31020      * <li> All angular arguments are in radians.
31021      *
31022      * <li> This function is a member of the following set:
31023      *{@code
31024      *         spherical      vector         solve for
31025      *
31026      *         iauTpxes      iauTpxev         xi,eta
31027      *       > iauTpsts <    iauTpstv          star
31028      *         iauTpors      iauTporv         origin
31029      * }
31030      *</ol>
31031      *  Called:
31032      *     iauAnp       normalize angle into range 0 to 2pi
31033      *
31034      *  References:
31035      *
31036      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31037      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31038      *
31039      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31040      *     1987, Chapter 13.
31041      *
31042      * @version   2018 January 2
31043      *
31044      * @since JSOFA release 20180130
31045      *
31046      */
31047     public static SphericalCoordinate jauTpsts(double xi, double eta, double a0, double b0)
31048     {
31049         double sb0, cb0, d;
31050 
31051         sb0 = sin(b0);
31052         cb0 = cos(b0);
31053         d = cb0 - eta*sb0;
31054         return new SphericalCoordinate( jauAnp(atan2(xi,d) + a0),
31055                 atan2(sb0+eta*cb0, sqrt(xi*xi+d*d)));
31056 
31057         /* Finished. */
31058     }
31059 
31060     /**
31061      * Tangent Plane Position consisting of (xi, eta) pairs in radians.
31062      * 
31063      * 
31064      * <p>Notes: <ol>
31065      *
31066      * <li> The tangent plane projection is also called the "gnomonic
31067      *     projection" and the "central projection".
31068      *
31069      * <li> The eta axis points due north in the adopted coordinate system.
31070      *     If the spherical coordinates are observed (RA,Dec), the tangent
31071      *     plane coordinates (xi,eta) are conventionally called the
31072      *     "standard coordinates".  For right-handed spherical coordinates,
31073      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31074      *     effectively, radians at the tangent point.
31075      *     </ol>
31076      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
31077      * 
31078      * @since JSOFA release 20180130
31079      */
31080     public static class TangentPlaneCoordinate {
31081         public double xi;
31082         public double eta;
31083         /** status.
31084          *                         0 = OK
31085          *                                1 = star too far from axis
31086          *                                2 = antistar on tangent plane
31087          *                                3 = antistar too far from axis
31088          */
31089         public int status;
31090         public TangentPlaneCoordinate(double xi, double eta, int j){
31091             this.xi = xi;
31092             this.eta = eta;
31093             this.status = j;
31094         }
31095     }
31096 
31097 
31098     /**
31099      *
31100      *  In the tangent plane projection, given the star's rectangular
31101      *  coordinates and the direction cosines of the tangent point, solve
31102      *  for the direction cosines of the star.
31103      *
31104      *  <p>This function is derived from the International Astronomical Union's
31105      *  SOFA (Standards of Fundamental Astronomy) software collection.
31106      *
31107      *  <p>Status:  support function.
31108      *
31109      * <!-- Given: -->
31110      *     @param xi  double     rectangular coordinates of star image (Note 2)
31111      *     @param eta  double     rectangular coordinates of star image (Note 2)
31112      *     @param v0      double[3]  tangent point's direction cosines
31113      *
31114      * <!-- Returned: -->
31115      *     @return      double[3]  star's direction cosines
31116      * <ol>
31117      * <li> The tangent plane projection is also called the "gnomonic
31118      *     projection" and the "central projection".
31119      *
31120      * <li> The eta axis points due north in the adopted coordinate system.
31121      *     If the direction cosines represent observed (RA,Dec), the tangent
31122      *     plane coordinates (xi,eta) are conventionally called the
31123      *     "standard coordinates".  If the direction cosines are with
31124      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31125      *     The units of (xi,eta) are, effectively, radians at the tangent
31126      *     point.
31127      *
31128      * <li> The method used is to complete the star vector in the (xi,eta)
31129      *     based triad and normalize it, then rotate the triad to put the
31130      *     tangent point at the pole with the x-axis aligned to zero
31131      *     longitude.  Writing (a0,b0) for the celestial spherical
31132      *     coordinates of the tangent point, the sequence of rotations is
31133      *     (b-pi/2) around the x-axis followed by (-a-pi/2) around the
31134      *     z-axis.
31135      *
31136      * <li> If vector v0 is not of unit length, the returned vector v will
31137      *     be wrong.
31138      *
31139      * <li> If vector v0 points at a pole, the returned vector v will be
31140      *     based on the arbitrary assumption that the longitude coordinate
31141      *     of the tangent point is zero.
31142      *
31143      * <li> This function is a member of the following set:
31144      *{@code
31145      *         spherical      vector         solve for
31146      *
31147      *         iauTpxes      iauTpxev         xi,eta
31148      *         iauTpsts    > iauTpstv <        star
31149      *         iauTpors      iauTporv         origin
31150      * }
31151      *</ol>
31152      *  References:
31153      *
31154      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31155      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31156      *
31157      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31158      *     1987, Chapter 13.
31159      *
31160      * @version   2018 January 2
31161      *
31162      * @since JSOFA release 20180130
31163      *
31164      */
31165     public static double[] jauTpstv(double xi, double eta, double v0[])
31166     {
31167         double x, y, z, f, r;
31168         double v[] = new double[3];
31169 
31170 
31171         /* Tangent point. */
31172         x = v0[0];
31173         y = v0[1];
31174         z = v0[2];
31175 
31176         /* Deal with polar case. */
31177         r = sqrt(x*x + y*y);
31178         if ( r == 0.0 ) {
31179             r = 1e-20;
31180             x = r;
31181         }
31182 
31183         /* Star vector length to tangent plane. */
31184         f = sqrt(1.0 + xi*xi + eta*eta);
31185 
31186         /* Apply the transformation and normalize. */
31187         v[0] = (x - (xi*y + eta*x*z) / r) / f;
31188         v[1] = (y + (xi*x - eta*y*z) / r) / f;
31189         v[2] = (z + eta*r) / f;
31190         return v;
31191 
31192         /* Finished. */
31193 
31194     }
31195 
31196     /**
31197      *
31198      *  In the tangent plane projection, given celestial spherical
31199      *  coordinates for a star and the tangent point, solve for the star's
31200      *  rectangular coordinates in the tangent plane.
31201      *
31202      *  <p>This function is derived from the International Astronomical Union's
31203      *  SOFA (Standards of Fundamental Astronomy) software collection.
31204      *
31205      *  <p>Status:  support function.
31206      *
31207      * <!-- Given: -->
31208      *     @param a       double  star's spherical coordinates
31209      *     @param b       double  star's spherical coordinates
31210      *     @param a0     double  tangent point's spherical coordinates
31211      *     @param b0     double  tangent point's spherical coordinates
31212      *
31213      * <!-- Returned: -->
31214      *     @return  rectangular coordinates of star image (Note 2)
31215       *               int     status:  0 = OK
31216      *                                1 = star too far from axis
31217      *                                2 = antistar on tangent plane
31218      *                                3 = antistar too far from axis
31219      *
31220      * <p>Notes: <ol>
31221      *
31222      * <li> The tangent plane projection is also called the "gnomonic
31223      *     projection" and the "central projection".
31224      *
31225      * <li> The eta axis points due north in the adopted coordinate system.
31226      *     If the spherical coordinates are observed (RA,Dec), the tangent
31227      *     plane coordinates (xi,eta) are conventionally called the
31228      *     "standard coordinates".  For right-handed spherical coordinates,
31229      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31230      *     effectively, radians at the tangent point.
31231      *
31232      * <li> All angular arguments are in radians.
31233      *
31234      * <li> This function is a member of the following set:
31235      *{@code
31236      *         spherical      vector         solve for
31237      *
31238      *       > iauTpxes <    iauTpxev         xi,eta
31239      *         iauTpsts      iauTpstv          star
31240      *         iauTpors      iauTporv         origin
31241      *}
31242      *</ol>
31243      *  References:
31244      *
31245      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31246      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31247      *
31248      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31249      *     1987, Chapter 13.
31250      *
31251      * @version   2018 January 2
31252      *
31253      * @since JSOFA release 20180130
31254      *
31255      */
31256     public static TangentPlaneCoordinate jauTpxes(double a, double b, double a0, double b0)
31257     {
31258         int j;
31259         double sb0, sb, cb0, cb, da, sda, cda, d;
31260 
31261 
31262         /* Functions of the spherical coordinates. */
31263         sb0 = sin(b0);
31264         sb = sin(b);
31265         cb0 = cos(b0);
31266         cb = cos(b);
31267         da = a - a0;
31268         sda = sin(da);
31269         cda = cos(da);
31270 
31271         /* Reciprocal of star vector length to tangent plane. */
31272         d = sb*sb0 + cb*cb0*cda;
31273 
31274         /* Check for error cases. */
31275         if ( d > TANGENT_TINY ) {
31276             j = 0;
31277         } else if ( d >= 0.0 ) {
31278             j = 1;
31279             d = TANGENT_TINY;
31280         } else if ( d > -TANGENT_TINY ) {
31281             j = 2;
31282             d = -TANGENT_TINY;
31283         } else {
31284             j = 3;
31285         }
31286 
31287         /* Return the tangent plane coordinates (even in dubious cases). */
31288         return new TangentPlaneCoordinate( cb*sda / d,
31289                 (sb*cb0 - cb*sb0*cda) / d, j);
31290 
31291 
31292         /* Finished. */
31293     }
31294 
31295     /**
31296      *
31297      *  In the tangent plane projection, given celestial direction cosines
31298      *  for a star and the tangent point, solve for the star's rectangular
31299      *  coordinates in the tangent plane.
31300      *
31301      *  <p>This function is derived from the International Astronomical Union's
31302      *  SOFA (Standards of Fundamental Astronomy) software collection.
31303      *
31304      *  <p>Status:  support function.
31305      *
31306      * <!-- Given: -->
31307      *     @param v         double[3]  direction cosines of star (Note 4)
31308      *     @param v0        double[3]  direction cosines of tangent point (Note 4)
31309      *
31310      * <!-- Returned: -->
31311      *     @return     tangent plane coordinates of star
31312      *               int        status: 0 = OK
31313      *                                  1 = star too far from axis
31314      *                                  2 = antistar on tangent plane
31315      *                                  3 = antistar too far from axis
31316      *
31317      * <p>Notes: <ol>
31318      *
31319      * <li> The tangent plane projection is also called the "gnomonic
31320      *     projection" and the "central projection".
31321      *
31322      * <li> The eta axis points due north in the adopted coordinate system.
31323      *     If the direction cosines represent observed (RA,Dec), the tangent
31324      *     plane coordinates (xi,eta) are conventionally called the
31325      *     "standard coordinates".  If the direction cosines are with
31326      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31327      *     The units of (xi,eta) are, effectively, radians at the tangent
31328      *     point.
31329      *
31330      * <li> The method used is to extend the star vector to the tangent
31331      *     plane and then rotate the triad so that (x,y) becomes (xi,eta).
31332      *     Writing (a,b) for the celestial spherical coordinates of the
31333      *     star, the sequence of rotations is (a+pi/2) around the z-axis
31334      *     followed by (pi/2-b) around the x-axis.
31335      *
31336      * <li> If vector v0 is not of unit length, or if vector v is of zero
31337      *     length, the results will be wrong.
31338      *
31339      * <li> If v0 points at a pole, the returned (xi,eta) will be based on
31340      *     the arbitrary assumption that the longitude coordinate of the
31341      *     tangent point is zero.
31342      *
31343      * <li> This function is a member of the following set:
31344      *{@code
31345      *         spherical      vector         solve for
31346      *
31347      *         iauTpxes    > iauTpxev <       xi,eta
31348      *         iauTpsts      iauTpstv          star
31349      *         iauTpors      iauTporv         origin
31350      * }
31351      *</ol>
31352      *  References:
31353      *
31354      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31355      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31356      *
31357      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31358      *     1987, Chapter 13.
31359      *
31360      * @version   2018 January 2
31361      *
31362      * @since JSOFA release 20180130
31363      *
31364      */
31365     public static TangentPlaneCoordinate jauTpxev(double v[], double v0[])
31366     {
31367         int j;
31368         double x, y, z, x0, y0, z0, r2, r, w, d;
31369 
31370 
31371         /* Star and tangent point. */
31372         x = v[0];
31373         y = v[1];
31374         z = v[2];
31375         x0 = v0[0];
31376         y0 = v0[1];
31377         z0 = v0[2];
31378 
31379         /* Deal with polar case. */
31380         r2 = x0*x0 + y0*y0;
31381         r = sqrt(r2);
31382         if ( r == 0.0 ) {
31383             r = 1e-20;
31384             x0 = r;
31385         }
31386 
31387         /* Reciprocal of star vector length to tangent plane. */
31388         w = x*x0 + y*y0;
31389         d = w + z*z0;
31390 
31391         /* Check for error cases. */
31392         if ( d > TANGENT_TINY ) {
31393             j = 0;
31394         } else if ( d >= 0.0 ) {
31395             j = 1;
31396             d = TANGENT_TINY;
31397         } else if ( d > -TANGENT_TINY ) {
31398             j = 2;
31399             d = -TANGENT_TINY;
31400         } else {
31401             j = 3;
31402         }
31403 
31404         /* Return the tangent plane coordinates (even in dubious cases). */
31405         d *= r;
31406         return new TangentPlaneCoordinate( (y*x0 - x*y0) / d,
31407                 (z*r2 - z0*w) / d, j);
31408 
31409 
31410         /* Finished. */
31411     }
31412 
31413     /**
31414      *  Convert B1950.0 FK4 star catalog data to J2000.0 FK5.
31415      *  This function converts a star's catalog data from the old FK4
31416      * (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system.
31417      *  
31418      *  <p>This function is derived from the International Astronomical Union's
31419      *  SOFA (Standards of Fundamental Astronomy) software collection.
31420      *  
31421      *  Status:  support function.
31422      *  
31423      * 
31424      *  <!-- Given: --> (all B1950.0, FK4)
31425      *     @param r1950    double   B1950.0 RA (rad)
31426      *     @param d1950    double   B1950.0 Dec (rad)
31427      *     @param dr1950  double   B1950.0 proper motions (rad/trop.yr)
31428      *     @param dd1950  double   B1950.0 proper motions (rad/trop.yr)
31429      *     @param p1950          double   parallax (arcsec)
31430      *     @paramv1950          double   radial velocity (km/s, +ve = moving away)
31431      *  Returned:
31432      *  
31433      *   @return  - catalogue coordinates (all J2000.0, FK5)
31434      *   
31435      * <p>Notes: <ol>
31436      * 
31437      * <li> The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt,
31438      *     and are per year rather than per century.
31439      * <li> The conversion is somewhat complicated, for several reasons:
31440      *     . Change of standard epoch from B1950.0 to J2000.0.
31441      *     . An intermediate transition date of 1984 January 1.0 TT.
31442      *     . A change of precession model.
31443      *     . Change of time unit for proper motion (tropical to Julian).
31444      *     . FK4 positions include the E-terms of aberration, to simplify
31445      *       the hand computation of annual aberration.  FK5 positions
31446      *       assume a rigorous aberration computation based on the Earth's
31447      *       barycentric velocity.
31448      *     . The E-terms also affect proper motions, and in particular cause
31449      *       objects at large distances to exhibit fictitious proper
31450      *       motions.
31451      *     The algorithm is based on Smith et al. (1989) and Yallop et al.
31452      *     (1989), which presented a matrix method due to Standish (1982) as
31453      *     developed by Aoki et al. (1983), using Kinoshita's development of
31454      *     Andoyer's post-Newcomb precession.  The numerical constants from
31455      *     Seidelmann (1992) are used canonically.
31456      * <li> Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for.
31457      *     Conversions for different epochs and equinoxes would require
31458      *     additional treatment for precession, proper motion and E-terms.
31459      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31460      *     of the poles do not embody differential E-terms effects and
31461      *     should, strictly speaking, be handled in a different manner from
31462      *     stars outside these regions.  However, given the general lack of
31463      *     homogeneity of the star data available for routine astrometry,
31464      *     the difficulties of handling positions that may have been
31465      *     determined from astrometric fields spanning the polar and non-
31466      *     polar regions, the likelihood that the differential E-terms
31467      *     effect was not taken into account when allowing for proper motion
31468      *     in past astrometry, and the undesirability of a discontinuity in
31469      *     the algorithm, the decision has been made in this SOFA algorithm
31470      *     to include the effects of differential E-terms on the proper
31471      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31472      *     and measuring "on the sky" rather than in terms of RA change, the
31473      *     errors resulting from this simplification are less than
31474      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31475      *     proper motion.
31476      * </ol>
31477      *  Called:
31478      *     iauAnp       normalize angle into range 0 to 2pi
31479      *     iauPv2s      pv-vector to spherical coordinates
31480      *     iauPdp       scalar product of two p-vectors
31481      *     iauPvmpv     pv-vector minus pv_vector
31482      *     iauPvppv     pv-vector plus pv_vector
31483      *     iauS2pv      spherical coordinates to pv-vector
31484      *     iauSxp       multiply p-vector by scalar
31485      * <p> References: <ul>
31486      * <li> Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31487      *     FK4-based positions of stars to epoch J2000.0 positions in
31488      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31489      *     128, 263-267.
31490      *  <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31491      *     Astronomical Almanac", ISBN 0-935702-68-7.
31492      * <li>Smith, C.A. et al., 1989, "The transformation of astrometric
31493      *     catalog systems to the equinox J2000.0".  Astron.J. 97, 265.
31494      * <li>Standish, E.M., 1982, "Conversion of positions and proper motions
31495      *     from B1950.0 to the IAU system at J2000.0".  Astron.Astrophys.,
31496      *     115, 1, 20-22.
31497      * <li>Yallop, B.D. et al., 1989, "Transformation of mean star places
31498      *     from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
31499      *     Astron.J. 97, 274.
31500      *     </ul>
31501      *  @version   2018 December 5
31502      *  @since SOFA release 2019-07-22
31503      */
31504     public static CatalogCoords jauFk425(double r1950, double d1950,
31505             double dr1950, double dd1950,
31506             double p1950, double v1950
31507             )
31508     {
31509         /* Radians per year to arcsec per century */
31510         final double PMF = 100.0*DR2AS;
31511 
31512         /* Small number to avoid arithmetic problems */
31513         final double TINY = 1e-30;
31514 
31515         /* Miscellaneous */
31516         double r, d, ur, ud, px, rv, pxvf, w;
31517         int i, j, k, l;
31518 
31519         /* Pv-vectors */
31520         double r0[][], 
31521         pv1[][], pv2[][] = new double[2][3];
31522 
31523         /*
31524          * CANONICAL CONSTANTS (Seidelmann 1992)
31525          */
31526 
31527         /* Km per sec to AU per tropical century */
31528         /* = 86400 * 36524.2198782 / 149597870.7 */
31529         final double VF = 21.095;
31530 
31531         /* Constant pv-vector (cf. Seidelmann 3.591-2, vectors A and Adot) */
31532         final double a[][] = new double[][] {
31533             { -1.62557e-6, -0.31919e-6, -0.13843e-6 },
31534             { +1.245e-3,   -1.580e-3,   -0.659e-3   }
31535         };
31536 
31537         /* 3x2 matrix of pv-vectors (cf. Seidelmann 3.591-4, matrix M) */
31538         final double em[][][][] = new double [][][][] {
31539 
31540             { { { +0.9999256782,     -0.0111820611,     -0.0048579477     },
31541                 { +0.00000242395018, -0.00000002710663, -0.00000001177656 } },
31542 
31543                 { { +0.0111820610,     +0.9999374784,     -0.0000271765     },
31544                     { +0.00000002710663, +0.00000242397878, -0.00000000006587 } },
31545 
31546                 { { +0.0048579479,     -0.0000271474,     +0.9999881997,    },
31547                         { +0.00000001177656, -0.00000000006582, +0.00000242410173 } } },
31548 
31549             { { { -0.000551,         -0.238565,         +0.435739        },
31550                 { +0.99994704,       -0.01118251,       -0.00485767       } },
31551 
31552                             { { +0.238514,         -0.002667,         -0.008541        },
31553                     { +0.01118251,       +0.99995883,       -0.00002718       } },
31554 
31555                             { { -0.435623,         +0.012254,         +0.002117         },
31556                         { +0.00485767,       -0.00002714,       +1.00000956       } } }
31557 
31558         };
31559 
31560         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31561 
31562         /* The FK4 data (units radians and arcsec per tropical century). */
31563         r = r1950;
31564         d = d1950;
31565         ur = dr1950*PMF;
31566         ud = dd1950*PMF;
31567         px = p1950;
31568         rv = v1950;
31569 
31570         /* Express as a pv-vector. */
31571         pxvf = px*VF;
31572         w = rv*pxvf;
31573         r0 = jauS2pv(r, d, 1.0, ur, ud, w);
31574 
31575         /* Allow for E-terms (cf. Seidelmann 3.591-2). */
31576         pv1 = jauPvmpv(r0, a);
31577         pv2[0] = jauSxp(jauPdp(r0[0], a[0]), r0[0]);
31578         pv2[1] = jauSxp(jauPdp(r0[0], a[1]), r0[0]);
31579         pv1 = jauPvppv(pv1, pv2);
31580 
31581         /* Convert pv-vector to Fricke system (cf. Seidelmann 3.591-3). */
31582         for ( i = 0; i < 2; i++ ) {
31583             for ( j = 0; j < 3; j++ ) {
31584                 w = 0.0;
31585                 for ( k = 0; k < 2; k++ ) {
31586                     for ( l = 0; l < 3; l++ ) {
31587                         w += em[i][j][k][l] * pv1[k][l];
31588                     }
31589                 }
31590                 pv2[i][j] = w;
31591             }
31592         }
31593 
31594         /* Revert to catalog form. */
31595         SphericalPositionVelocity sv = jauPv2s(pv2);//, &r, &d, &w, &ur, &ud, &rd);
31596         if ( px > TINY ) {
31597             rv = sv.vel.r/pxvf;
31598             px = px/sv.pos.r;
31599         }
31600 
31601         /* Return the results. */
31602         return new CatalogCoords(jauAnp(sv.pos.theta), sv.pos.phi, sv.vel.theta/PMF, sv.vel.phi/PMF, px, rv);
31603 
31604     }  
31605 
31606 
31607     /**
31608      *  Convert a B1950.0 FK4 star position to J2000.0 FK5, assuming zero
31609      *  proper motion in the FK5 system.
31610      *  <p>This function is derived from the International Astronomical Union's
31611      *  SOFA (Standards of Fundamental Astronomy) software collection.
31612      *  Status:  support function.
31613      *  This function converts a star's catalog data from the old FK4
31614      *  (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system,
31615      *  in such a way that the FK5 proper motion is zero.  Because such a
31616      *  star has, in general, a non-zero proper motion in the FK4 system,
31617      *  the routine requires the epoch at which the position in the FK4
31618      *  system was determined.
31619      *  
31620      *  <!-- Given: -->
31621      *     @param r1950    double   B1950.0 FK4 RA at epoch (rad)
31622      *     @param d1950    double   B1950.0 FK4 Dec at epoch (rad)
31623      *     @param bepoch         double   Besselian epoch (e.g. 1979.3D0)
31624      * <!-- Returned: -->
31625      *     @return  J2000.0 FK5 RA,Dec (rad)
31626      * <p>Notes: <ol>
31627 
31628      * <li> The epoch bepoch is strictly speaking Besselian, but if a
31629      *     Julian epoch is supplied the result will be affected only to a
31630      *     negligible extent.
31631      * <li> The method is from Appendix 2 of Aoki et al. (1983), but using
31632      *     the constants of Seidelmann (1992).  See the routine iauFk425
31633      *     for a general introduction to the FK4 to FK5 conversion.
31634      * <li> Conversion from equinox B1950.0 FK4 to equinox J2000.0 FK5 only
31635      *     is provided for.  Conversions for different starting and/or
31636      *     ending epochs would require additional treatment for precession,
31637      *     proper motion and E-terms.
31638      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31639      *     of the poles do not embody differential E-terms effects and
31640      *     should, strictly speaking, be handled in a different manner from
31641      *     stars outside these regions.  However, given the general lack of
31642      *     homogeneity of the star data available for routine astrometry,
31643      *     the difficulties of handling positions that may have been
31644      *     determined from astrometric fields spanning the polar and non-
31645      *     polar regions, the likelihood that the differential E-terms
31646      *     effect was not taken into account when allowing for proper motion
31647      *     in past astrometry, and the undesirability of a discontinuity in
31648      *     the algorithm, the decision has been made in this SOFA algorithm
31649      *     to include the effects of differential E-terms on the proper
31650      *     motions for all stars, whether polar or not.  At epoch 2000.0,
31651      *     and measuring "on the sky" rather than in terms of RA change, the
31652      *     errors resulting from this simplification are less than
31653      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31654      *     proper motion.
31655      * </ol>
31656      * <p> References: <ul>
31657      * <li>Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31658      *     FK4-based positions of stars to epoch J2000.0 positions in
31659      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31660      *     128, 263-267.
31661      * <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31662      *     Astronomical Almanac", ISBN 0-935702-68-7.
31663      * </ul>
31664      *  Called:
31665      *     iauAnp       normalize angle into range 0 to 2pi
31666      *     iauC2s       p-vector to spherical
31667      *     iauEpb2jd    Besselian epoch to Julian date
31668      *     iauEpj       Julian date to Julian epoch
31669      *     iauPdp       scalar product of two p-vectors
31670      *     iauPmp       p-vector minus p-vector
31671      *     iauPpsp      p-vector plus scaled p-vector
31672      *     iauPvu       update a pv-vector
31673      *     iauS2c       spherical to p-vector
31674      *  @version   2018 December 5
31675      *  @since SOFA release 2019-07-22
31676      */
31677     public static SphericalCoordinate jauFk45z(double r1950, double d1950, double bepoch)
31678     {
31679         /* Radians per year to arcsec per century */
31680         final double PMF = 100.0*DR2AS;
31681 
31682         /* Position and position+velocity vectors */
31683         double r0[], p[], pv[][] = new double[2][3];
31684 
31685         /* Miscellaneous */
31686         double w;
31687         int i, j, k;
31688 
31689         /*
31690          * CANONICAL CONSTANTS (Seidelmann 1992)
31691          */
31692 
31693         /* Vectors A and Adot (Seidelmann 3.591-2) */
31694         final double a[]  = new double[]{ -1.62557e-6, -0.31919e-6, -0.13843e-6 };
31695         final double ad[] = new double[]{ +1.245e-3,   -1.580e-3,   -0.659e-3   };
31696 
31697         /* 3x2 matrix of p-vectors (cf. Seidelmann 3.591-4, matrix M) */
31698         final double em[][][] = new double[][][] {
31699             { { +0.9999256782, -0.0111820611, -0.0048579477 },
31700                 { +0.0111820610, +0.9999374784, -0.0000271765 },
31701                 { +0.0048579479, -0.0000271474, +0.9999881997 } },
31702             { { -0.000551,     -0.238565,     +0.435739     },
31703                     { +0.238514,     -0.002667,     -0.008541     },
31704                     { -0.435623,     +0.012254,     +0.002117     } }
31705         };
31706 
31707         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31708 
31709         /* Spherical coordinates to p-vector. */
31710         r0 = jauS2c(r1950, d1950);
31711 
31712         /* Adjust p-vector A to give zero proper motion in FK5. */
31713         w  = (bepoch - 1950) / PMF;
31714         p = jauPpsp(a, w, ad );
31715 
31716         /* Remove E-terms. */
31717         p = jauPpsp(p, -jauPdp(r0,p), r0);
31718         p = jauPmp(r0, p);
31719 
31720         /* Convert to Fricke system pv-vector (cf. Seidelmann 3.591-3). */
31721         for ( i = 0; i < 2; i++ ) {
31722             for ( j = 0; j < 3; j++ ) {
31723                 w = 0.0;
31724                 for ( k = 0; k < 3; k++ ) {
31725                     w += em[i][j][k] * p[k];
31726                 }
31727                 pv[i][j] = w;
31728             }
31729         }
31730 
31731         /* Allow for fictitious proper motion. */
31732         JulianDate jd = jauEpb2jd(bepoch);
31733         w = (jauEpj(jd.djm0,jd.djm1)-2000.0) / PMF;
31734         pv = jauPvu(w, pv);
31735 
31736         /* Revert to spherical coordinates. */
31737         SphericalCoordinate sc = jauC2s(pv[0]);
31738         sc.alpha = jauAnp(sc.alpha);
31739         return sc;
31740 
31741     }
31742 
31743 
31744     /**
31745      *  Convert J2000.0 FK5 star catalog data to B1950.0 FK4.
31746       *  <p>This function is derived from the International Astronomical Union's
31747      *  SOFA (Standards of Fundamental Astronomy) software collection.
31748      *  Status:  support function.
31749      *  <!--Given: (all J2000.0, FK5) -->
31750      *     @param r2000   double   J2000.0 RA (rad)
31751      *     @param d2000    double   J2000.0 Dec (rad)
31752      *     @param dr2000  double   J2000.0 proper motions (rad/Jul.yr)
31753      *     @param dd2000  double   J2000.0 proper motions (rad/Jul.yr)
31754      *     @param p2000          double   parallax (arcsec)
31755      *     @param v2000          double   radial velocity (km/s, +ve = moving away)
31756      *  
31757      *   @return (all B1950.0, FK4)
31758      * <p>Notes: <ol>
31759 
31760      * <li> The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt,
31761      *     and are per year rather than per century.
31762      * <li> The conversion is somewhat complicated, for several reasons:
31763      *     . Change of standard epoch from J2000.0 to B1950.0.
31764      *     . An intermediate transition date of 1984 January 1.0 TT.
31765      *     . A change of precession model.
31766      *     . Change of time unit for proper motion (Julian to tropical).
31767      *     . FK4 positions include the E-terms of aberration, to simplify
31768      *       the hand computation of annual aberration.  FK5 positions
31769      *       assume a rigorous aberration computation based on the Earth's
31770      *       barycentric velocity.
31771      *     . The E-terms also affect proper motions, and in particular cause
31772      *       objects at large distances to exhibit fictitious proper
31773      *       motions.
31774      *     The algorithm is based on Smith et al. (1989) and Yallop et al.
31775      *     (1989), which presented a matrix method due to Standish (1982) as
31776      *     developed by Aoki et al. (1983), using Kinoshita's development of
31777      *     Andoyer's post-Newcomb precession.  The numerical constants from
31778      *     Seidelmann (1992) are used canonically.
31779      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31780      *     of the poles do not embody differential E-terms effects and
31781      *     should, strictly speaking, be handled in a different manner from
31782      *     stars outside these regions.  However, given the general lack of
31783      *     homogeneity of the star data available for routine astrometry,
31784      *     the difficulties of handling positions that may have been
31785      *     determined from astrometric fields spanning the polar and non-
31786      *     polar regions, the likelihood that the differential E-terms
31787      *     effect was not taken into account when allowing for proper motion
31788      *     in past astrometry, and the undesirability of a discontinuity in
31789      *     the algorithm, the decision has been made in this SOFA algorithm
31790      *     to include the effects of differential E-terms on the proper
31791      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31792      *     and measuring "on the sky" rather than in terms of RA change, the
31793      *     errors resulting from this simplification are less than
31794      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31795      *     proper motion.
31796      * </ol>
31797      *  Called:
31798      *     iauAnp       normalize angle into range 0 to 2pi
31799      *     iauPdp       scalar product of two p-vectors
31800      *     iauPm        modulus of p-vector
31801      *     iauPmp       p-vector minus p-vector
31802      *     iauPpp       p-vector pluus p-vector
31803      *     iauPv2s      pv-vector to spherical coordinates
31804      *     iauS2pv      spherical coordinates to pv-vector
31805      *     iauSxp       multiply p-vector by scalar
31806      * <p> References: <ul>
31807      * <li>Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31808      *     FK4-based positions of stars to epoch J2000.0 positions in
31809      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31810      *     128, 263-267.
31811      * <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31812      *     Astronomical Almanac", ISBN 0-935702-68-7.
31813      * <li>Smith, C.A. et al., 1989, "The transformation of astrometric
31814      *     catalog systems to the equinox J2000.0".  Astron.J. 97, 265.
31815      * <li>Standish, E.M., 1982, "Conversion of positions and proper motions
31816      *     from B1950.0 to the IAU system at J2000.0".  Astron.Astrophys.,
31817      *     115, 1, 20-22.
31818      * <li>Yallop, B.D. et al., 1989, "Transformation of mean star places
31819      *     from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
31820      *     Astron.J. 97, 274.
31821      *     </ul>
31822      *  @version   2018 December 5
31823      *  @since SOFA release 2019-07-22
31824      */
31825     public static CatalogCoords jauFk524(double r2000, double d2000,
31826             double dr2000, double dd2000,
31827             double p2000, double v2000)
31828     {
31829         /* Radians per year to arcsec per century */
31830         final double PMF = 100.0*DR2AS;
31831 
31832         /* Small number to avoid arithmetic problems */
31833         final double TINY = 1e-30;
31834 
31835         /* Miscellaneous */
31836         double r, d, ur, ud, px, rv, pxvf, w;
31837         int i, j, k, l;
31838 
31839         /* Vectors, p and pv */
31840         double r0[][], r1[][] = new double[2][3], p1[], p2[], pv[][] = new double[2][3];
31841 
31842         /*
31843          * CANONICAL CONSTANTS (Seidelmann 1992)
31844          */
31845 
31846         /* Km per sec to AU per tropical century */
31847         /* = 86400 * 36524.2198782 / 149597870.7 */
31848         final double VF = 21.095;
31849 
31850         /* Constant pv-vector (cf. Seidelmann 3.591-2, vectors A and Adot) */
31851         final double a[][] = new double[][] {
31852             { -1.62557e-6, -0.31919e-6, -0.13843e-6 },
31853             { +1.245e-3,   -1.580e-3,   -0.659e-3   }
31854         };
31855 
31856         /* 3x2 matrix of pv-vectors (cf. Seidelmann 3.592-1, matrix M^-1) */
31857         final double em[][][][] = new double[][][][] {
31858 
31859             { { { +0.9999256795,     +0.0111814828,     +0.0048590039,    },
31860                 { -0.00000242389840, -0.00000002710544, -0.00000001177742 } },
31861 
31862                 { { -0.0111814828,     +0.9999374849,     -0.0000271771,    },
31863                     { +0.00000002710544, -0.00000242392702, +0.00000000006585 } },
31864 
31865                 { { -0.0048590040,     -0.0000271557,     +0.9999881946,    },
31866                         { +0.00000001177742, +0.00000000006585, -0.00000242404995 } } },
31867 
31868             { { { -0.000551,         +0.238509,         -0.435614,        },
31869                 { +0.99990432,       +0.01118145,       +0.00485852       } },
31870 
31871                             { { -0.238560,         -0.002667,         +0.012254,        },
31872                     { -0.01118145,       +0.99991613,       -0.00002717       } },
31873 
31874                             { { +0.435730,         -0.008541,         +0.002117,        },
31875                         { -0.00485852,       -0.00002716,       +0.99996684       } } }
31876 
31877         };
31878 
31879         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31880 
31881         /* The FK5 data (units radians and arcsec per Julian century). */
31882         r = r2000;
31883         d = d2000;
31884         ur = dr2000*PMF;
31885         ud = dd2000*PMF;
31886         px = p2000;
31887         rv = v2000;
31888 
31889         /* Express as a pv-vector. */
31890         pxvf = px * VF;
31891         w = rv * pxvf;
31892         r0 = jauS2pv(r, d, 1.0, ur, ud, w);
31893 
31894         /* Convert pv-vector to Bessel-Newcomb system (cf. Seidelmann 3.592-1). */
31895         for ( i = 0; i < 2; i++ ) {
31896             for ( j = 0; j < 3; j++ ) {
31897                 w = 0.0;
31898                 for ( k = 0; k < 2; k++ ) {
31899                     for ( l = 0; l < 3; l++ ) {
31900                         w += em[i][j][k][l] * r0[k][l];
31901                     }
31902                 }
31903                 r1[i][j] = w;
31904             }
31905         }
31906 
31907         /* Apply E-terms (equivalent to Seidelmann 3.592-3, two iterations). */
31908 
31909         /* Direction. */
31910         w = jauPm(r1[0]);
31911         p1 =jauSxp(jauPdp(r1[0],a[0]), r1[0]);
31912         p2 = jauSxp(w, a[0]);
31913         p1 = jauPmp(p2, p1);
31914         p1 = jauPpp(r1[0], p1);
31915 
31916         /* Recompute length. */
31917         w = jauPm(p1);
31918 
31919         /* Direction. */
31920         p1 = jauSxp(jauPdp(r1[0],a[0]), r1[0]);
31921         p2 = jauSxp(w, a[0]);
31922         p1 = jauPmp(p2, p1);
31923         pv[0] = jauPpp(r1[0], p1);
31924 
31925         /* Derivative. */
31926         p1 =jauSxp(jauPdp(r1[0],a[1]), pv[0]);
31927         p2 = jauSxp(w, a[1]);
31928         p1 = jauPmp(p2, p1);
31929         pv[1] = jauPpp(r1[1], p1);
31930 
31931         /* Revert to catalog form. */
31932         SphericalPositionVelocity sv = jauPv2s(pv);//, &r, &d, &w, &ur, &ud, &rd);
31933         if ( px > TINY ) {
31934             rv = sv.vel.r/pxvf;
31935             px = px/sv.pos.r;
31936         }
31937 
31938         /* Return the results. */
31939         return new CatalogCoords(jauAnp(sv.pos.theta), sv.pos.phi, sv.vel.theta/PMF, sv.vel.phi/PMF, px, rv);
31940     }
31941 
31942     /**
31943      *  Convert a J2000.0 FK5 star position to B1950.0 FK4, assuming zero
31944      *  proper motion in FK5 and parallax.
31945      *  <p>This function is derived from the International Astronomical Union's
31946      *  SOFA (Standards of Fundamental Astronomy) software collection.
31947      *  Status:  support function.
31948      *     @param r2000    double   J2000.0 FK5 RA (rad)
31949      *     @param d2000    double   J2000.0 FK5 Dec (rad)
31950      *     @param bepoch         double   Besselian epoch (e.g. 1950.0)
31951      *     @return    B1950.0 FK4 RA,Dec (rad) at epoch BEPOCH
31952      * 
31953      * <p>Notes: <ol>
31954 
31955      * <li> In contrast to the iauFk524  routine, here the FK5 proper
31956      *     motions, the parallax and the radial velocity are presumed zero.
31957      * <li> This function converts a star position from the IAU 1976 FK5
31958      *    (Fricke) system to the former FK4 (Bessel-Newcomb) system, for
31959      *     cases such as distant radio sources where it is presumed there is
31960      *     zero parallax and no proper motion.  Because of the E-terms of
31961      *     aberration, such objects have (in general) non-zero proper motion
31962      *     in FK4, and the present routine returns those fictitious proper
31963      *     motions.
31964      * <li> Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for.
31965      *     Conversions involving other equinoxes would require additional
31966      *     treatment for precession.
31967      * <li> The position returned by this routine is in the B1950.0 FK4
31968      *     reference system but at Besselian epoch BEPOCH.  For comparison
31969      *     with catalogs the BEPOCH argument will frequently be 1950.0. (In
31970      *     this context the distinction between Besselian and Julian epoch
31971      *     is insignificant.)
31972      * <li> The RA component of the returned (fictitious) proper motion is
31973      *     dRA/dt rather than cos(Dec)*dRA/dt.
31974      * </ol>
31975      *  Called:
31976      *     jauAnp       normalize angle into range 0 to 2pi
31977      *     jauC2s       p-vector to spherical
31978      *     jauFk524     FK4 to FK5
31979      *     jauS2c       spherical to p-vector
31980      *  @version   2018 December 5
31981      *  @since SOFA release 2019-07-22
31982      */
31983     public static CatalogCoords jauFk54z(double r2000, double d2000, double bepoch)
31984     {
31985         double  p[], w, v[]= new double[3];
31986         int i;
31987 
31988 
31989         /* FK5 equinox J2000.0 to FK4 equinox B1950.0. */
31990         CatalogCoords cc = jauFk524(r2000, d2000, 0.0, 0.0, 0.0, 0.0);
31991 
31992         /* Spherical to Cartesian. */
31993         p = jauS2c(cc.pos.alpha, cc.pos.delta );
31994 
31995         /* Fictitious proper motion (radians per year). */
31996         v[0] = - cc.pm.alpha*p[1] - cc.pm.delta*cos(cc.pos.alpha)*sin(cc.pos.delta);
31997         v[1] =   cc.pm.alpha*p[0] - cc.pm.delta*sin(cc.pos.alpha)*sin(cc.pos.delta);
31998         v[2] =             cc.pm.delta*cos(cc.pos.delta);
31999 
32000         /* Apply the motion. */
32001         w = bepoch - 1950.0;
32002         for ( i = 0; i < 3; i++ ) {
32003             p[i] += w*v[i];
32004         }
32005 
32006         /* Cartesian to spherical. */
32007         SphericalCoordinate sp = jauC2s(p);
32008         cc.pos.alpha = jauAnp(sp.alpha);
32009         cc.pos.delta = sp.delta;
32010 
32011         return cc;
32012 
32013     }
32014 }
32015 
32016 /*
32017  * Copyright © 2019 Paul Harrison, University of Manchester.
32018  * 
32019  * This JSOFA software is derived from the official C release of the "Standards Of Fundamental Astronomy" (SOFA) library 
32020  * of the International Astronomical Union. The intention is to reproduce the functionality and algorithms of 
32021  * the official SOFA library in a pure Java form.
32022  * 
32023  * The responsibility for the maintenance and supply of the JSOFA library lies with the author (not the IAU SOFA Board), 
32024  * However, The JSOFA software is provided "as is" and the author makes no warranty as to its use or performance. 
32025  * The author does not and cannot warrant the performance or results which the user may obtain by using the JSOFA software. 
32026  * The author makes no warranties, express or implied, as to non-infringement of third party rights, merchantability,
32027  * or fitness for any particular purpose. In no event will the author be liable to the user for any consequential, 
32028  * incidental, or special damages, including any lost profits or lost savings, even if the author has been advised
32029  * of such damages, or for any claim by any third party.
32030  * 
32031  * Other conditions of the original license (reproduced below) are carried over as applicable.
32032  */
32033 
32034 /*----------------------------------------------------------------------
32035 *
32036 *  Copyright (C) 2019
32037 *  Standards Of Fundamental Astronomy Board
32038 *  of the International Astronomical Union.
32039 *
32040 *  =====================
32041 *  SOFA Software License
32042 *  =====================
32043 *
32044 *  NOTICE TO USER:
32045 *
32046 *  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
32047 *  CONDITIONS WHICH APPLY TO ITS USE.
32048 *
32049 *  1. The Software is owned by the IAU SOFA Board ("SOFA").
32050 *
32051 *  2. Permission is granted to anyone to use the SOFA software for any
32052 *     purpose, including commercial applications, free of charge and
32053 *     without payment of royalties, subject to the conditions and
32054 *     restrictions listed below.
32055 *
32056 *  3. You (the user) may copy and distribute SOFA source code to others,
32057 *     and use and adapt its code and algorithms in your own software,
32058 *     on a world-wide, royalty-free basis.  That portion of your
32059 *     distribution that does not consist of intact and unchanged copies
32060 *     of SOFA source code files is a "derived work" that must comply
32061 *     with the following requirements:
32062 *
32063 *     a) Your work shall be marked or carry a statement that it
32064 *        (i) uses routines and computations derived by you from
32065 *        software provided by SOFA under license to you; and
32066 *        (ii) does not itself constitute software provided by and/or
32067 *        endorsed by SOFA.
32068 *
32069 *     b) The source code of your derived work must contain descriptions
32070 *        of how the derived work is based upon, contains and/or differs
32071 *        from the original SOFA software.
32072 *
32073 *     c) The names of all routines in your derived work shall not
32074 *        include the prefix "iau" or "sofa" or trivial modifications
32075 *        thereof such as changes of case.
32076 *
32077 *     d) The origin of the SOFA components of your derived work must
32078 *        not be misrepresented;  you must not claim that you wrote the
32079 *        original software, nor file a patent application for SOFA
32080 *        software or algorithms embedded in the SOFA software.
32081 *
32082 *     e) These requirements must be reproduced intact in any source
32083 *        distribution and shall apply to anyone to whom you have
32084 *        granted a further right to modify the source code of your
32085 *        derived work.
32086 *
32087 *     Note that, as originally distributed, the SOFA software is
32088 *     intended to be a definitive implementation of the IAU standards,
32089 *     and consequently third-party modifications are discouraged.  All
32090 *     variations, no matter how minor, must be explicitly marked as
32091 *     such, as explained above.
32092 *
32093 *  4. You shall not cause the SOFA software to be brought into
32094 *     disrepute, either by misuse, or use for inappropriate tasks, or
32095 *     by inappropriate modification.
32096 *
32097 *  5. The SOFA software is provided "as is" and SOFA makes no warranty
32098 *     as to its use or performance.   SOFA does not and cannot warrant
32099 *     the performance or results which the user may obtain by using the
32100 *     SOFA software.  SOFA makes no warranties, express or implied, as
32101 *     to non-infringement of third party rights, merchantability, or
32102 *     fitness for any particular purpose.  In no event will SOFA be
32103 *     liable to the user for any consequential, incidental, or special
32104 *     damages, including any lost profits or lost savings, even if a
32105 *     SOFA representative has been advised of such damages, or for any
32106 *     claim by any third party.
32107 *
32108 *  6. The provision of any version of the SOFA software under the terms
32109 *     and conditions specified herein does not imply that future
32110 *     versions will also be made available under the same terms and
32111 *     conditions.
32112 *
32113 *  In any published work or commercial product which uses the SOFA
32114 *  software directly, acknowledgement (see www.iausofa.org) is
32115 *  appreciated.
32116 *
32117 *  Correspondence concerning SOFA software should be addressed as
32118 *  follows:
32119 *
32120 *      By email:  sofa@ukho.gov.uk
32121 *      By post:   IAU SOFA Center
32122 *                 HM Nautical Almanac Office
32123 *                 UK Hydrographic Office
32124 *                 Admiralty Way, Taunton
32125 *                 Somerset, TA1 2DN
32126 *                 United Kingdom
32127 *
32128 *--------------------------------------------------------------------*/
32129 
32130 
32131 /*
32132  * $Log$
32133  */